mirror of
https://github.com/ruby/ruby.git
synced 2026-08-03 13:08:59 +08:00
fix control flow
`do { ...; continue; } while(0)` doesn't retry the loop body.
pointed out by Coverity Scan and mame.
This commit is contained in:
parent
a6d673a284
commit
8e6fd8fed4
Notes:
git
2026-07-01 20:19:35 +00:00
6
hash.c
6
hash.c
@ -712,7 +712,7 @@ ar_force_convert_table(VALUE hash, const char *file, int line)
|
||||
RUBY_ASSERT(rb_gc_obj_slot_size(hash) >= sizeof(struct RHash) + sizeof(ar_table));
|
||||
|
||||
// prepare hash values
|
||||
do {
|
||||
while (1) {
|
||||
st_data_t keys[RHASH_AR_TABLE_MAX_SIZE];
|
||||
bound = RHASH_AR_TABLE_BOUND(hash);
|
||||
size = RHASH_AR_TABLE_SIZE(hash);
|
||||
@ -727,7 +727,9 @@ ar_force_convert_table(VALUE hash, const char *file, int line)
|
||||
if (UNLIKELY(!RHASH_AR_TABLE_P(hash))) return RHASH_ST_TABLE(hash);
|
||||
if (UNLIKELY(RHASH_AR_TABLE_BOUND(hash) != bound)) continue;
|
||||
if (UNLIKELY(ar_each_key(ar, bound, ar_each_key_cmp, keys, NULL, NULL))) continue;
|
||||
} while (0);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// make st
|
||||
st_table tab;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user