mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Should not copy keys&values when a hash table is empty; fix #4270
This commit is contained in:
@@ -536,6 +536,7 @@ ht_copy(mrb_state *mrb, htable *t)
|
||||
|
||||
seg = t->rootseg;
|
||||
t2 = ht_new(mrb);
|
||||
if (t->size == 0) return t2;
|
||||
|
||||
while (seg) {
|
||||
for (i=0; i<seg->size; i++) {
|
||||
|
||||
Reference in New Issue
Block a user