mruby-metaprog: narrow the scope of a local variable

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-01-04 11:18:14 +09:00
parent 2ce5c52726
commit 9ee7d955e3
+1 -2
View File
@@ -176,7 +176,6 @@ static mrb_value
mrb_class_instance_method_list(mrb_state *mrb, mrb_bool recur, struct RClass *klass)
{
mrb_value ary;
struct RClass *oldklass;
khash_t(st) *set = kh_init(st, mrb);
if (!recur) {
@@ -187,8 +186,8 @@ mrb_class_instance_method_list(mrb_state *mrb, mrb_bool recur, struct RClass *kl
}
else {
khash_t(st) *undef = kh_init(st, mrb);
struct RClass *oldklass = NULL;
oldklass = NULL;
while (klass && (klass != oldklass)) {
method_entry_loop(mrb, klass, set, undef);
oldklass = klass;