[前][次][番号順一覧][スレッド一覧]

ruby-changes:36288

From: ko1 <ko1@a...>
Date: Tue, 11 Nov 2014 10:42:31 +0900 (JST)
Subject: [ruby-changes:36288] ko1:r48369 (trunk): * string.c (sym_equal): use rb_obj_equal().

ko1	2014-11-11 10:42:01 +0900 (Tue, 11 Nov 2014)

  New Revision: 48369

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=48369

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/string.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 48368)
+++ ChangeLog	(revision 48369)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Nov 11 10:37:09 2014  Koichi Sasada  <ko1@a...>
+
+	* 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@g...>
 
 	* lib/rdoc/known_classes.rb: reverted regression changes of
Index: string.c
===================================================================
--- string.c	(revision 48368)
+++ string.c	(revision 48369)
@@ -8484,13 +8484,7 @@ str_scrub_bang(int argc, VALUE *argv, VA https://github.com/ruby/ruby/blob/trunk/string.c#L8484
  *  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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]