зеркало из https://github.com/github/ruby.git
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:
Родитель
228118482e
Коммит
c5f4345138
8
gc.c
8
gc.c
|
@ -9389,13 +9389,15 @@ get_envparam_double(const char *name, double *default_value, double lower_bound,
|
|||
}
|
||||
}
|
||||
else {
|
||||
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;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Загрузка…
Ссылка в новой задаче