From: Yukihiro "Matz" Matsumoto Date: Fri, 21 Oct 2022 04:41:38 +0000 (+0900) Subject: mruby-hash-ext/hash.c (hash_values_at): early return from the function. X-Git-Tag: 3.2.0-rc~267 X-Git-Url: https://repo.or.cz/mruby.git/commitdiff_plain/3b55a09f919e37b1ed9babc4c54ec5671ccdb421 mruby-hash-ext/hash.c (hash_values_at): early return from the function. --- diff --git a/mrbgems/mruby-hash-ext/src/hash-ext.c b/mrbgems/mruby-hash-ext/src/hash-ext.c index 9c85858fe..b634373f4 100644 --- a/mrbgems/mruby-hash-ext/src/hash-ext.c +++ b/mrbgems/mruby-hash-ext/src/hash-ext.c @@ -29,6 +29,7 @@ hash_values_at(mrb_state *mrb, mrb_value hash) mrb_get_args(mrb, "*", &argv, &argc); result = mrb_ary_new_capa(mrb, argc); + if (argc == 0) return result; ai = mrb_gc_arena_save(mrb); for (i = 0; i < argc; i++) { mrb_ary_push(mrb, result, mrb_hash_get(mrb, hash, argv[i]));