mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Small refactoring in hash_slice; ref #4926
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user