From 0645c4536b8c397a11ee142b3af0a71a620fbcea Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Mon, 29 Aug 2022 15:14:46 +0900 Subject: [PATCH] readflt.c: small style modifications. --- src/readflt.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/readflt.c b/src/readflt.c index b320a43c1..db5899edf 100644 --- a/src/readflt.c +++ b/src/readflt.c @@ -51,7 +51,8 @@ mrb_float_read(const char *str, char **end) ++n; } a = p; - } else if (*p != '.') + } + else if (*p != '.') goto done; d *= sign; @@ -61,15 +62,14 @@ mrb_float_read(const char *str, char **end) double base = 0.1; ++p; - if (ISDIGIT(*p)) - { - while (*p && ISDIGIT(*p)) { - f += base * (*p - '0') ; - base /= 10.0; - ++p; - ++n; - } + if (ISDIGIT(*p)) { + while (*p && ISDIGIT(*p)) { + f += base * (*p - '0') ; + base /= 10.0; + ++p; + ++n; } + } d += f * sign; a = p; } @@ -83,7 +83,8 @@ mrb_float_read(const char *str, char **end) if (*p == '-') { sign = -1; ++p; - } else if (*p == '+') + } + else if (*p == '+') ++p; if (ISDIGIT(*p)) {