@@ -502,25 +502,22 @@ LIBC_INLINE int convert_float_decimal_typed(Writer *writer,
502
502
503
503
const size_t positive_blocks = float_converter.get_positive_blocks ();
504
504
505
- if (positive_blocks >= 0 ) {
506
- // This loop iterates through the number a block at a time until it finds a
507
- // block that is not zero or it hits the decimal point. This is because all
508
- // zero blocks before the first nonzero digit or the decimal point are
509
- // ignored (no leading zeroes, at least at this stage).
510
- int32_t i = static_cast <int32_t >(positive_blocks) - 1 ;
511
- for (; i >= 0 ; --i) {
512
- BlockInt digits = float_converter.get_positive_block (i);
513
- if (nonzero) {
514
- RET_IF_RESULT_NEGATIVE (float_writer.write_middle_block (digits));
515
- } else if (digits != 0 ) {
516
- size_t blocks_before_decimal = i;
517
- float_writer.init ((blocks_before_decimal * BLOCK_SIZE) +
518
- (has_decimal_point ? 1 : 0 ) + precision,
519
- blocks_before_decimal * BLOCK_SIZE);
520
- float_writer.write_first_block (digits);
521
-
522
- nonzero = true ;
523
- }
505
+ // This loop iterates through the number a block at a time until it finds a
506
+ // block that is not zero or it hits the decimal point. This is because all
507
+ // zero blocks before the first nonzero digit or the decimal point are
508
+ // ignored (no leading zeroes, at least at this stage).
509
+ for (int32_t i = static_cast <int32_t >(positive_blocks) - 1 ; i >= 0 ; --i) {
510
+ BlockInt digits = float_converter.get_positive_block (i);
511
+ if (nonzero) {
512
+ RET_IF_RESULT_NEGATIVE (float_writer.write_middle_block (digits));
513
+ } else if (digits != 0 ) {
514
+ size_t blocks_before_decimal = i;
515
+ float_writer.init ((blocks_before_decimal * BLOCK_SIZE) +
516
+ (has_decimal_point ? 1 : 0 ) + precision,
517
+ blocks_before_decimal * BLOCK_SIZE);
518
+ float_writer.write_first_block (digits);
519
+
520
+ nonzero = true ;
524
521
}
525
522
}
526
523
0 commit comments