@@ -186,11 +186,10 @@ template <WriteMode write_mode> class FloatWriter {
186
186
if (total_digits_written < digits_before_decimal &&
187
187
total_digits_written + buffered_digits >= digits_before_decimal &&
188
188
has_decimal_point) {
189
+ // digits_to_write > 0 guaranteed by outer if
189
190
size_t digits_to_write = digits_before_decimal - total_digits_written;
190
- if (digits_to_write > 0 ) {
191
- // Write the digits before the decimal point.
192
- RET_IF_RESULT_NEGATIVE (writer->write ({block_buffer, digits_to_write}));
193
- }
191
+ // Write the digits before the decimal point.
192
+ RET_IF_RESULT_NEGATIVE (writer->write ({block_buffer, digits_to_write}));
194
193
RET_IF_RESULT_NEGATIVE (writer->write (DECIMAL_POINT));
195
194
if (buffered_digits > digits_to_write) {
196
195
// Write the digits after the decimal point.
@@ -217,10 +216,9 @@ template <WriteMode write_mode> class FloatWriter {
217
216
total_digits_written + BLOCK_SIZE * max_block_count >=
218
217
digits_before_decimal &&
219
218
has_decimal_point) {
219
+ // digits_to_write > 0 guaranteed by outer if
220
220
size_t digits_to_write = digits_before_decimal - total_digits_written;
221
- if (digits_to_write > 0 ) {
222
- RET_IF_RESULT_NEGATIVE (writer->write (MAX_BLOCK_DIGIT, digits_to_write));
223
- }
221
+ RET_IF_RESULT_NEGATIVE (writer->write (MAX_BLOCK_DIGIT, digits_to_write));
224
222
RET_IF_RESULT_NEGATIVE (writer->write (DECIMAL_POINT));
225
223
if ((BLOCK_SIZE * max_block_count) > digits_to_write) {
226
224
RET_IF_RESULT_NEGATIVE (writer->write (
0 commit comments