From: | Ranier Vilela <ranier_gyn(at)hotmail(dot)com> |
---|---|
To: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | [PATCH] Style, remove redudant test "if (zeropadlen > 0)" |
Date: | 2019-11-24 16:12:10 |
Message-ID: | MN2PR18MB2927850AB00CF39CC370D107E34B0@MN2PR18MB2927.namprd18.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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
Attachment | Content-Type | Size |
---|---|---|
snprintf.c.patch | application/octet-stream | 649 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Mark Dilger | 2019-11-24 16:17:55 | Re: [PATCH] Style, remove redudant test "if (zeropadlen > 0)" |
Previous Message | Fabien COELHO | 2019-11-24 15:57:29 | Re: Copyright information in source files |