Skip to content

Commit

Permalink
Small risk...removing from 1.7.0 release.
Browse files Browse the repository at this point in the history
Revert "Add a common == path for Array, to avoid respond_to? checks on nil"

This reverts commit 2d82363.
  • Loading branch information
headius committed Oct 17, 2012
1 parent 6d7f778 commit 37bf9ac
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1933,17 +1933,12 @@ public IRubyObject checkArrayType(){
@JRubyMethod(name = "==", required = 1)
@Override
public IRubyObject op_equal(ThreadContext context, IRubyObject obj) {
Ruby runtime = context.runtime;

if (this == obj) {
return runtime.getTrue();
return context.runtime.getTrue();
}

if (!(obj instanceof RubyArray)) {
if (obj == context.nil) return runtime.getFalse();

if (!obj.respondsTo("to_ary")) {
return runtime.getFalse();
return context.runtime.getFalse();
}
return RuntimeHelpers.rbEqual(context, obj, this);
}
Expand Down

0 comments on commit 37bf9ac

Please sign in to comment.