ruby-changes:46779
From: ko1 <ko1@a...>
Date: Fri, 26 May 2017 14:27:03 +0900 (JST)
Subject: [ruby-changes:46779] ko1:r58895 (trunk): Symbol support for opt_eq_func.
ko1 2017-05-26 14:26:57 +0900 (Fri, 26 May 2017) New Revision: 58895 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58895 Log: Symbol support for opt_eq_func. * vm_insnhelper.c (opt_eq_func): optimize for symbol comparison. [Bug #13330] [fix GH-1540] Modified files: trunk/vm_insnhelper.c Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 58894) +++ vm_insnhelper.c (revision 58895) @@ -1325,6 +1325,11 @@ opt_eq_func(VALUE recv, VALUE obj, CALL_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1325 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); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/