Skip to content

Commit b49ae45

Browse files
authored
Remove dead post-hoc rehash check
Hash#rehash checks whether the hash is iterating, and with VWA, RHASH_ST_TABLE() always returns the same thing for the same hash. RHASH_ST_TABLE(VALUE h) { return (st_table *)((uintptr_t)h + sizeof(struct RHash)); } So this check can never fail and raise an exception. Remove it.
1 parent bd27460 commit b49ae45

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

hash.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,13 +1312,8 @@ hash_foreach_iter(st_data_t key, st_data_t value, st_data_t argp, int error)
13121312

13131313
if (error) return ST_STOP;
13141314

1315-
st_table *tbl = RHASH_ST_TABLE(arg->hash);
13161315
int status = (*arg->func)((VALUE)key, (VALUE)value, arg->arg);
13171316

1318-
if (RHASH_ST_TABLE(arg->hash) != tbl) {
1319-
rb_raise(rb_eRuntimeError, "rehash occurred during iteration");
1320-
}
1321-
13221317
return hash_iter_status_check(status);
13231318
}
13241319

0 commit comments

Comments
 (0)