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

ruby-changes:56350

From: Nobuyoshi <ko1@a...>
Date: Wed, 3 Jul 2019 02:13:28 +0900 (JST)
Subject: [ruby-changes:56350] Nobuyoshi Nakada: bdddaa9f56 (master): Use rb_ident_hash_new instead of rb_hash_new_compare_by_id

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

From bdddaa9f56702e1d3a58a14607e9881052424b53 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 3 Jul 2019 02:09:01 +0900
Subject: Use rb_ident_hash_new instead of rb_hash_new_compare_by_id

The latter is same as the former, removed the duplicate function.

diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c
index c7f5a5e..05026e1 100644
--- a/ext/coverage/coverage.c
+++ b/ext/coverage/coverage.c
@@ -54,7 +54,7 @@ rb_coverage_start(int argc, VALUE *argv, VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/coverage/coverage.c#L54
     }
 
     if (mode & COVERAGE_TARGET_METHODS) {
-	me2counter = rb_hash_new_compare_by_id();
+	me2counter = rb_ident_hash_new();
     }
     else {
 	me2counter = Qnil;
diff --git a/hash.c b/hash.c
index be4fc21..df77e89 100644
--- a/hash.c
+++ b/hash.c
@@ -1364,14 +1364,6 @@ rb_hash_new(void) https://github.com/ruby/ruby/blob/trunk/hash.c#L1364
     return hash_alloc(rb_cHash);
 }
 
-VALUE
-rb_hash_new_compare_by_id(void)
-{
-    VALUE hash = rb_hash_new();
-    RHASH_ST_TABLE_SET(hash, rb_init_identtable());
-    return hash;
-}
-
 MJIT_FUNC_EXPORTED VALUE
 rb_hash_new_with_size(st_index_t size)
 {
diff --git a/internal.h b/internal.h
index c844617..f2c9e9a 100644
--- a/internal.h
+++ b/internal.h
@@ -1605,9 +1605,6 @@ struct st_table *rb_hash_tbl_raw(VALUE hash); https://github.com/ruby/ruby/blob/trunk/internal.h#L1605
 #endif
 
 VALUE rb_hash_new_with_size(st_index_t size);
-RUBY_SYMBOL_EXPORT_BEGIN
-VALUE rb_hash_new_compare_by_id(void);
-RUBY_SYMBOL_EXPORT_END
 VALUE rb_hash_has_key(VALUE hash, VALUE key);
 VALUE rb_hash_default_value(VALUE hash, VALUE key);
 VALUE rb_hash_set_default_proc(VALUE hash, VALUE proc);
diff --git a/variable.c b/variable.c
index 476701d..7d6905f 100644
--- a/variable.c
+++ b/variable.c
@@ -2020,7 +2020,7 @@ rb_autoload_str(VALUE mod, ID id, VALUE file) https://github.com/ruby/ruby/blob/trunk/variable.c#L2020
     }
     file = rb_fstring(file);
     if (!autoload_featuremap) {
-        autoload_featuremap = rb_hash_new_compare_by_id();
+        autoload_featuremap = rb_ident_hash_new();
         rb_obj_hide(autoload_featuremap);
         rb_gc_register_mark_object(autoload_featuremap);
     }
diff --git a/vm_eval.c b/vm_eval.c
index be645ec..068944d 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -2028,7 +2028,7 @@ rb_catch_obj(VALUE t, VALUE (*func)(), VALUE data) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L2028
 static void
 local_var_list_init(struct local_var_list *vars)
 {
-    vars->tbl = rb_hash_new_compare_by_id();
+    vars->tbl = rb_ident_hash_new();
     RBASIC_CLEAR_CLASS(vars->tbl);
 }
 
-- 
cgit v0.10.2


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

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