Thread: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"
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
On 11/24/19 8:12 AM, Ranier Vilela wrote: > Hi, > The test "if (zeropadlen > 0)" is redundant and can be salely removed. > It has already been tested in the same path. I have not tested your patch, but it looks right to me. -- Mark Dilger
>I have not tested your patch, but it looks right to me. Thanks for review. Best regards. Ranier Vilela
On Sun, Nov 24, 2019 at 8:12 AM Ranier Vilela <ranier_gyn@hotmail.com> wrote:
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
Could you please at least take the time to produce a patch that actually applies properly?
If the patch does not have the proper path from the root of the source tree than it is completely worthless to most folks because it's really not appropriate to ask someone to fix your patch when the tools are clearly available to properly produce a patch without any issue.
Specifically git diff does this without issue.
Thanks in advance
John
Mark Dilger <hornschnorter@gmail.com> writes: > On 11/24/19 8:12 AM, Ranier Vilela wrote: >> The test "if (zeropadlen > 0)" is redundant and can be salely removed. >> It has already been tested in the same path. > I have not tested your patch, but it looks right to me. Agreed, seems like an oversight in an old patch of mine. Pushed. I concur with John's nearby complaint that you're not submitting diffs in a useful format. The file paths are weird. Also, it's generally proven to be a good idea to send diffs as attachments, not embedded in-line in the email --- in-line text is far too prone to get mangled by assorted mail programs. regards, tom lane
>Could you please at least take the time to produce a patch that actually applies properly? Yes of course. Thank you. Ranier Vilela