Small refactoring in hash_slice; ref #4926

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-01-10 17:57:33 +09:00
parent dc86e35cac
commit fc8fb41451
+1 -3
View File
@@ -53,10 +53,8 @@ hash_slice(mrb_state *mrb, mrb_value hash)
mrb_int argc, i;
mrb_get_args(mrb, "*", &argv, &argc);
if (argc == 0) {
return mrb_hash_new_capa(mrb, argc);
}
result = mrb_hash_new_capa(mrb, argc);
if (argc == 0) return result; /* empty hash */
for (i = 0; i < argc; i++) {
mrb_value key = argv[i];
mrb_value val;