aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-11-24 12:03:16 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2019-11-24 12:03:16 -0500
commit91da65f4ac2837e0792071e42b2e2101059f1b1b (patch)
tree350a3f50684ed987341762f629a697fd533d6b26
parent45ff049e288b0fc7d68195b25ba1a78522e7a45b (diff)
downloadpostgresql-91da65f4ac2837e0792071e42b2e2101059f1b1b.tar.gz
postgresql-91da65f4ac2837e0792071e42b2e2101059f1b1b.zip
Remove a couple of unnecessary if-tests.
Commit abd9ca377 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
-rw-r--r--src/port/snprintf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/port/snprintf.c b/src/port/snprintf.c
index e4bb15dfec1..5c827ef6fe4 100644
--- a/src/port/snprintf.c
+++ b/src/port/snprintf.c
@@ -1227,16 +1227,14 @@ fmtfloat(double value, char type, int forcesign, int leftjust,
{
/* pad before exponent */
dostr(convert, epos - convert, target);
- if (zeropadlen > 0)
- dopr_outchmulti('0', zeropadlen, target);
+ dopr_outchmulti('0', zeropadlen, target);
dostr(epos, vallen - (epos - convert), target);
}
else
{
/* no exponent, pad after the digits */
dostr(convert, vallen, target);
- if (zeropadlen > 0)
- dopr_outchmulti('0', zeropadlen, target);
+ dopr_outchmulti('0', zeropadlen, target);
}
}
else