Skip to content

Commit

Permalink
Symbol defines its own #== to avoid #<=> String creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed May 7, 2015
1 parent 55376a0 commit 6428f5e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/src/main/java/org/jruby/RubySymbol.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,13 @@ public IRubyObject id2name(ThreadContext context) {
@JRubyMethod(name = "===", required = 1)
@Override
public IRubyObject op_eqq(ThreadContext context, IRubyObject other) {
return super.op_equal(context, other);
return context.runtime.newBoolean(this == other);
}

@JRubyMethod(name = "==", required = 1)
@Override
public IRubyObject op_equal(ThreadContext context, IRubyObject other) {
return context.runtime.newBoolean(this == other);
}

@Deprecated
Expand Down

0 comments on commit 6428f5e

Please sign in to comment.