remove redundant mrb_hash_get call

`mrb_hash_delete` returns the removed element (which is guaranteed to
exist due to the `mrb_hash_key_p` check), this prevents the hash from
being searched twice.
This commit is contained in:
leviongit
2026-03-20 21:20:18 +01:00
parent 01ce2f8c71
commit 88e356e7da
+1 -3
View File
@@ -2703,10 +2703,8 @@ RETRY_TRY_BLOCK:
if (kidx < 0 || !mrb_hash_p(kdict=regs[kidx]) || !mrb_hash_key_p(mrb, kdict, k)) {
RAISE_FORMAT(mrb, E_ARGUMENT_ERROR, "missing keyword: %v", k);
}
v = mrb_hash_get(mrb, kdict, k);
ci = mrb->c->ci;
v = mrb_hash_delete_key(mrb, kdict, k);
regs[a] = v;
mrb_hash_delete_key(mrb, kdict, k);
ci = mrb->c->ci;
NEXT;
}