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

ruby-changes:61018

From: Nobuyoshi <ko1@a...>
Date: Wed, 6 May 2020 09:48:24 +0900 (JST)
Subject: [ruby-changes:61018] b0498caa7e (master): Removed unnecessary duplicate code

https://git.ruby-lang.org/ruby.git/commit/?id=b0498caa7e

From b0498caa7e92e3f53affb822ba73394624808c98 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 6 May 2020 09:43:49 +0900
Subject: Removed unnecessary duplicate code

`rb_equal` may be inlined in `case_equal` and actually same code
is generated twice.

diff --git a/object.c b/object.c
index 9830fef..30c3ba2 100644
--- a/object.c
+++ b/object.c
@@ -141,12 +141,9 @@ rb_obj_setup(VALUE obj, VALUE klass, VALUE type) https://github.com/ruby/ruby/blob/trunk/object.c#L141
  * Same as \c Object#===, case equality.
  *++
  */
-static VALUE
-case_equal(VALUE obj1, VALUE obj2) {
+#define case_equal rb_equal
     /* The default implementation of #=== is
      * to call #== with the rb_equal() optimization. */
-    return rb_equal(obj1, obj2);
-}
 
 /*!
  * This function is an optimized version of calling #==.
-- 
cgit v0.10.2


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

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