Move fmt_setup until absolutely necessary.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-05-27 14:09:36 +09:00
parent 15c63688e3
commit a476c83caf
+1 -1
View File
@@ -1082,7 +1082,6 @@ retry:
break;
}
fmt_setup(fbuf, sizeof(fbuf), *p, flags, width, prec);
need = 0;
if (*p != 'e' && *p != 'E') {
int i;
@@ -1104,6 +1103,7 @@ retry:
need += 20;
CHECK(need);
fmt_setup(fbuf, sizeof(fbuf), *p, flags, width, prec);
n = mrb_float_to_cstr(mrb, &buf[blen], need, fbuf, fval);
if (n < 0 || n >= need) {
mrb_raise(mrb, E_RUNTIME_ERROR, "formatting error");