Should not copy keys&values when a hash table is empty; fix #4270

parent 639f6e27
......@@ -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++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment