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:
parent
228118482e
commit
c5f4345138
Notes:
git
2020-06-29 11:07:05 +09:00
1 changed files with 6 additions and 4 deletions
10
gc.c
10
gc.c
|
@ -9389,13 +9389,15 @@ get_envparam_double(const char *name, double *default_value, double lower_bound,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
accept:
|
goto accept;
|
||||||
if (RTEST(ruby_verbose)) fprintf(stderr, "%s=%f (default value: %f)\n", name, val, *default_value);
|
|
||||||
*default_value = val;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
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
|
static void
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue