Permalink
Browse files

Renumber hash keys during dup since there may be duplicates.

  • Loading branch information...
clayton-shopify committed Mar 28, 2017
1 parent 5ec051f commit a6e25f73a05bb0292c0c9f10b77c5cdaf260e4d0
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/hash.c
View
@@ -246,7 +246,8 @@ mrb_hash_dup(mrb_state *mrb, mrb_value hash)
int ai = mrb_gc_arena_save(mrb);
ret_k = kh_put(ht, mrb, ret_h, KEY(kh_key(h, k)));
mrb_gc_arena_restore(mrb, ai);
kh_val(ret_h, ret_k) = kh_val(h, k);
kh_val(ret_h, ret_k).v = kh_val(h, k).v;
kh_val(ret_h, ret_k).n = kh_size(ret_h)-1;
}
}
}

0 comments on commit a6e25f7

Please sign in to comment.