bc: tweak bc_num_parseDecimal() for readability, logic is not changed

function                                             old     new   delta
zbc_program_num                                      836     835      -1

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2018-12-14 16:24:01 +01:00
parent 240d7ee3fc
commit 87b49beeda

View File

@ -2334,13 +2334,13 @@ static void bc_num_parseDecimal(BcNum *n, const char *val)
n->num[n->len] = val[i] - '0'; n->num[n->len] = val[i] - '0';
++n->len; ++n->len;
skip_dot: skip_dot:
if ((ssize_t)--i == (ssize_t)-1) break; if (i == 0) break;
if (val[i] == '.') goto skip_dot; if (val[--i] == '.') goto skip_dot;
} }
break; break;
} }
} }
// if this is reached, the value is entirely zero // if for() exits without hitting if(), the value is entirely zero
} }
// Note: n is already "bc_num_zero()"ed, // Note: n is already "bc_num_zero()"ed,