[PATCH] Style, remove redudant test "if (zeropadlen > 0)"
Ranier VF <ranier_gyn@hotmail.com>
From: Ranier Vilela <ranier_gyn@hotmail.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-11-24T16:12:10Z
Lists: pgsql-hackers
Attachments
- snprintf.c.patch (application/octet-stream) patch
Hi,
The test "if (zeropadlen > 0)" is redundant and can be salely removed.
It has already been tested in the same path.
Best regards,
Ranier Vilela
--- \dll\postgresql\a\port\snprintf.c 2019-11-23 13:19:20.000000000 -0300
+++ snprintf.c 2019-11-24 13:02:45.510806400 -0300
@@ -1227,16 +1227,14 @@
{
/* 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
Commits
-
Remove a couple of unnecessary if-tests.
- 91da65f4ac28 13.0 landed