Skip to content

Commit

Permalink
Symbol support for opt_eq_func.
Browse files Browse the repository at this point in the history
* vm_insnhelper.c (opt_eq_func): optimize for symbol comparison.
  [Bug #13330] [fix GH-1540]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ko1 committed May 26, 2017
1 parent 8dce622 commit ad0f8ff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1325,6 +1325,11 @@ opt_eq_func(VALUE recv, VALUE obj, CALL_INFO ci, CALL_CACHE cc)
return rb_str_equal(recv, obj);
}
}
else if (SYMBOL_P(recv) && SYMBOL_P(obj)) {
if (EQ_UNREDEFINED_P(SYMBOL)) {
return (recv == obj) ? Qtrue : Qfalse;
}
}

{
vm_search_method(ci, cc, recv);
Expand Down

0 comments on commit ad0f8ff

Please sign in to comment.