Use rb_ident_hash_new instead of rb_hash_new_compare_by_id

The latter is same as the former, removed the duplicate function.
This commit is contained in:
Nobuyoshi Nakada 2019-07-03 02:09:01 +09:00
parent 0f283054e7
commit bdddaa9f56
No known key found for this signature in database
GPG Key ID: 4BC7D6DF58D8DF60
5 changed files with 3 additions and 14 deletions

View File

@ -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;

8
hash.c
View File

@ -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)
{

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}