Skip to content

Commit 56a9028

Browse files
Simpler code suggestions
Co-authored-by: Niels Dossche <[email protected]>
1 parent 8ecf974 commit 56a9028

File tree

1 file changed

+1
-5
lines changed
  • ext/bcmath/libbcmath/src

1 file changed

+1
-5
lines changed

ext/bcmath/libbcmath/src/div.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,8 @@ static inline void bc_divide_by_pow_10(
317317
const char *numeratorptr, size_t numerator_readable_size, bc_num *quot, size_t quot_size, size_t quot_scale)
318318
{
319319
char *qptr = (*quot)->n_value;
320-
if (quot_size <= quot_scale) {
321-
/* int is 0 */
320+
for (size_t i = quot_size; i <= quot_scale; i++) {
322321
*qptr++ = 0;
323-
for (size_t i = quot_size; i < quot_scale; i++) {
324-
*qptr++ = 0;
325-
}
326322
}
327323

328324
size_t numerator_use_size = quot_size > numerator_readable_size ? numerator_readable_size : quot_size;

0 commit comments

Comments
 (0)