diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-06-23 14:54:50 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-23 14:54:50 +0900 |
commit | 73529a12bbf5bb88b2596ca1169bd29dc75aa2e6 (patch) | |
tree | 2286fc3c47dbe1593e5c5465d8c4681e0b75308b /hash.c | |
parent | 00c1bd66d6fa24bd50bd3f20334ec162d0279f40 (diff) |
Declare `RHASH_AR_TABLE` and `RHASH_ST_TABLE` return non-null
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/7976
Merged-By: nobu <[email protected]>
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -725,7 +725,8 @@ ar_force_convert_table(VALUE hash, const char *file, int line) return RHASH_ST_TABLE(hash); } - if (RHASH_AR_TABLE(hash)) { + RUBY_ASSERT(RHASH_AR_TABLE(hash)); + { unsigned i, bound = RHASH_AR_TABLE_BOUND(hash); rb_st_init_existing_table_with_size(new_tab, &objhash, RHASH_AR_TABLE_SIZE(hash)); @@ -738,9 +739,6 @@ ar_force_convert_table(VALUE hash, const char *file, int line) } ar_free_and_clear_table(hash); } - else { - rb_st_init_existing_table_with_size(new_tab, &objhash, 0); - } RHASH_ST_TABLE_SET(hash, new_tab); |