diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-11 01:42:01 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-11-11 01:42:01 +0000 |
commit | 495548ace4587df43d30b021cfa6b2f84c9d9d44 (patch) | |
tree | cfd9853405c10c36f88795ce97f9a1b58282947f | |
parent | d5b7a701ebdf87221bd73af447d34f9b5bb8df5e (diff) | |
download | ruby-495548ace4587df43d30b021cfa6b2f84c9d9d44.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | string.c | 8 |
2 files changed, 10 insertions, 7 deletions
@@ -1,3 +1,12 @@ +Tue Nov 11 10:37:09 2014 Koichi Sasada <ko1@atdot.net> + + * 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. + Tue Nov 11 09:38:55 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com> * lib/rdoc/known_classes.rb: reverted regression changes of @@ -8484,13 +8484,7 @@ str_scrub_bang(int argc, VALUE *argv, VALUE str) * symbol, returns <code>true</code>. */ -static VALUE -sym_equal(VALUE sym1, VALUE sym2) -{ - if (sym1 == sym2) return Qtrue; - return Qfalse; -} - +#define sym_equal rb_obj_equal static int sym_printable(const char *s, const char *send, rb_encoding *enc) |