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

ruby-changes:54503

From: ko1 <ko1@a...>
Date: Sat, 5 Jan 2019 09:06:14 +0900 (JST)
Subject: [ruby-changes:54503] ko1:r66718 (trunk): call functions directly.

ko1	2019-01-05 09:06:09 +0900 (Sat, 05 Jan 2019)

  New Revision: 66718

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

  Log:
    call functions directly.
    
    * hash.c: ar_table only supports `objhash` so we can call compare/hash
      functions directly.

  Modified files:
    trunk/hash.c
Index: hash.c
===================================================================
--- hash.c	(revision 66717)
+++ hash.c	(revision 66718)
@@ -307,7 +307,7 @@ static const struct st_hash_type identha https://github.com/ruby/ruby/blob/trunk/hash.c#L307
     rb_ident_hash,
 };
 
-#define EQUAL(x,y) ((x) == (y) || (*objhash.compare)((x),(y)) == 0)
+#define EQUAL(x,y) ((x) == (y) || rb_any_cmp((x),(y)) == 0)
 #define PTR_EQUAL(ptr, hash_val, key_) \
     ((ptr)->hash == (hash_val) && EQUAL((key_), (ptr)->key))
 
@@ -354,7 +354,7 @@ rb_hash_ar_table_size(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L354
 static inline st_hash_t
 do_hash(st_data_t key)
 {
-    st_hash_t hash = (st_hash_t)(*objhash.hash)(key);
+    st_hash_t hash = (st_hash_t)rb_any_hash(key);
     return (RESERVED_HASH_VAL == hash) ? RESERVED_HASH_SUBSTITUTION_VAL : hash;
 }
 

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

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