Skip to content

Commit 91da65f

Browse files
committed
Remove a couple of unnecessary if-tests.
Commit abd9ca3 replaced a couple of while-loops in fmtfloat() with calls to dopr_outchmulti, but I (tgl) failed to notice that the new if-tests guarding those calls were really unnecessary, because they're inside a larger if-block checking the same thing. Ranier Vilela Discussion: https://postgr.es/m/MN2PR18MB2927850AB00CF39CC370D107E34B0@MN2PR18MB2927.namprd18.prod.outlook.com
1 parent 45ff049 commit 91da65f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/port/snprintf.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,16 +1227,14 @@ fmtfloat(double value, char type, int forcesign, int leftjust,
12271227
{
12281228
/* pad before exponent */
12291229
dostr(convert, epos - convert, target);
1230-
if (zeropadlen > 0)
1231-
dopr_outchmulti('0', zeropadlen, target);
1230+
dopr_outchmulti('0', zeropadlen, target);
12321231
dostr(epos, vallen - (epos - convert), target);
12331232
}
12341233
else
12351234
{
12361235
/* no exponent, pad after the digits */
12371236
dostr(convert, vallen, target);
1238-
if (zeropadlen > 0)
1239-
dopr_outchmulti('0', zeropadlen, target);
1237+
dopr_outchmulti('0', zeropadlen, target);
12401238
}
12411239
}
12421240
else

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy