Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 683a26c

Browse files
committed
[refactor] minor - env isn't null around here
1 parent 1bf79da commit 683a26c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

core/src/main/java/org/jruby/RubyKernel.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,10 +1683,7 @@ public static IRubyObject system(ThreadContext context, IRubyObject recv, IRubyO
16831683

16841684
// else old JDK logic
16851685
if (args[0] instanceof RubyHash) {
1686-
RubyHash env = args[0].convertToHash();
1687-
if (env != null) {
1688-
runtime.getENV().merge_bang(context, env, Block.NULL_BLOCK);
1689-
}
1686+
runtime.getENV().merge_bang(context, (RubyHash) args[0], Block.NULL_BLOCK);
16901687
// drop the first element for calling systemCommon()
16911688
args = ArraySupport.newCopy(args, 1, args.length - 1);
16921689
}
@@ -1775,7 +1772,7 @@ private static IRubyObject execCommon(ThreadContext context, IRubyObject env, IR
17751772
}
17761773
}
17771774

1778-
if (env != null && !env.isNil()) {
1775+
if (env != null && env != context.nil) {
17791776
RubyHash envMap = env.convertToHash();
17801777
if (envMap != null) {
17811778
runtime.getENV().merge_bang(context, envMap, Block.NULL_BLOCK);

0 commit comments

Comments
 (0)