Skip to content

Commit

Permalink
Tweak a few more double-hop true/false/nil to use context fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Apr 12, 2018
1 parent d4d4e31 commit e8b8f24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyHash.java
Expand Up @@ -2129,9 +2129,9 @@ private IRubyObject any_p_p(ThreadContext context, IRubyObject pattern) {
for (RubyHashEntry entry = head.nextAdded; entry != head; entry = entry.nextAdded) {
IRubyObject newAssoc = RubyArray.newArray(context.runtime, entry.key, entry.value);
if (pattern.callMethod(context, "===", newAssoc).isTrue())
return context.runtime.getTrue();
return context.tru;
}
return context.runtime.getFalse();
return context.fals;
} finally {
iteratorExit();
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyString.java
Expand Up @@ -4272,7 +4272,7 @@ public IRubyObject delete_suffix(ThreadContext context, IRubyObject arg) {
public IRubyObject delete_prefix_bang(ThreadContext context, IRubyObject arg) {
modifyCheck();
RubyString result = (RubyString) delete_prefix(context, arg);
if (equals(result)) return context.runtime.getNil();
if (equals(result)) return context.nil;
replaceInternal19(0, this.strLength(), result);
return this;
}
Expand All @@ -4281,7 +4281,7 @@ public IRubyObject delete_prefix_bang(ThreadContext context, IRubyObject arg) {
public IRubyObject delete_suffix_bang(ThreadContext context, IRubyObject arg) {
modifyCheck();
RubyString result = (RubyString) delete_suffix(context, arg);
if (equals(result)) return context.runtime.getNil();
if (equals(result)) return context.nil;
replaceInternal19(0, this.strLength(), result);
return this;
}
Expand Down

0 comments on commit e8b8f24

Please sign in to comment.