1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

get_envparam_double: do not goto into a branch

I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea.  Better refactor.
This commit is contained in:
卜部昌平 2020-06-15 14:36:41 +09:00
parent 228118482e
commit c5f4345138
Notes: git 2020-06-29 11:07:05 +09:00

10
gc.c
View file

@ -9389,13 +9389,15 @@ get_envparam_double(const char *name, double *default_value, double lower_bound,
}
}
else {
accept:
if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f)\n", name, val, *default_value);
*default_value = val;
return 1;
goto accept;
}
}
return 0;
accept:
if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f)\n", name, val, *default_value);
*default_value = val;
return 1;
}
static void