diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-03 02:09:01 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-07-03 02:09:01 +0900 |
commit | bdddaa9f56702e1d3a58a14607e9881052424b53 (patch) | |
tree | ccbb221801b714a90148cf8454ff69b7e4f27d0d | |
parent | 0f283054e7f568f09fbfc952d57ea6daf4abbd88 (diff) | |
download | ruby-bdddaa9f56702e1d3a58a14607e9881052424b53.tar.gz |
Use rb_ident_hash_new instead of rb_hash_new_compare_by_id
The latter is same as the former, removed the duplicate function.
-rw-r--r-- | ext/coverage/coverage.c | 2 | ||||
-rw-r--r-- | hash.c | 8 | ||||
-rw-r--r-- | internal.h | 3 | ||||
-rw-r--r-- | variable.c | 2 | ||||
-rw-r--r-- | vm_eval.c | 2 |
5 files changed, 3 insertions, 14 deletions
diff --git a/ext/coverage/coverage.c b/ext/coverage/coverage.c index c7f5a5e34b..05026e1ba2 100644 --- a/ext/coverage/coverage.c +++ b/ext/coverage/coverage.c @@ -54,7 +54,7 @@ rb_coverage_start(int argc, VALUE *argv, VALUE klass) } if (mode & COVERAGE_TARGET_METHODS) { - me2counter = rb_hash_new_compare_by_id(); + me2counter = rb_ident_hash_new(); } else { me2counter = Qnil; @@ -1364,14 +1364,6 @@ rb_hash_new(void) 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 c84461792f..f2c9e9a814 100644 --- a/internal.h +++ b/internal.h @@ -1605,9 +1605,6 @@ struct st_table *rb_hash_tbl_raw(VALUE hash); #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 476701d060..7d6905f390 100644 --- a/variable.c +++ b/variable.c @@ -2020,7 +2020,7 @@ rb_autoload_str(VALUE mod, ID id, VALUE file) } 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); } @@ -2028,7 +2028,7 @@ rb_catch_obj(VALUE t, VALUE (*func)(), VALUE data) 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); } |