Skip to content

Commit 495548a

Browse files
committed
* string.c (sym_equal): use rb_obj_equal().
rb_obj_equal() is specially optimized in opt_eq_func()@vm_insnhelper.c. This fix is made from this discussion: https://www.omniref.com/ruby/2.1.4/symbols/Symbol/%3D%3D#line=8361. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent d5b7a70 commit 495548a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Tue Nov 11 10:37:09 2014 Koichi Sasada <ko1@atdot.net>
2+
3+
* string.c (sym_equal): use rb_obj_equal().
4+
rb_obj_equal() is specially optimized in
5+
opt_eq_func()@vm_insnhelper.c.
6+
7+
This fix is made from this discussion:
8+
https://www.omniref.com/ruby/2.1.4/symbols/Symbol/%3D%3D#line=8361.
9+
110
Tue Nov 11 09:38:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
211

312
* lib/rdoc/known_classes.rb: reverted regression changes of

string.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -8484,13 +8484,7 @@ str_scrub_bang(int argc, VALUE *argv, VALUE str)
84848484
* symbol, returns <code>true</code>.
84858485
*/
84868486

8487-
static VALUE
8488-
sym_equal(VALUE sym1, VALUE sym2)
8489-
{
8490-
if (sym1 == sym2) return Qtrue;
8491-
return Qfalse;
8492-
}
8493-
8487+
#define sym_equal rb_obj_equal
84948488

84958489
static int
84968490
sym_printable(const char *s, const char *send, rb_encoding *enc)

0 commit comments

Comments
 (0)