Thread

Commits

  1. Remove a couple of unnecessary if-tests.

  1. [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    Ranier VF <ranier_gyn@hotmail.com> — 2019-11-24T16:12:10Z

    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
    
  2. Re: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    Mark Dilger <hornschnorter@gmail.com> — 2019-11-24T16:17:55Z

    
    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
    
    
    
    
  3. RE: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    Ranier VF <ranier_gyn@hotmail.com> — 2019-11-24T16:27:01Z

    >I have not tested your patch, but it looks right to me.
    Thanks for review.
    
    Best regards.
    Ranier Vilela
    
    
    
  4. Re: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    John W Higgins <wishdev@gmail.com> — 2019-11-24T16:30:53Z

    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
    
  5. Re: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    Tom Lane <tgl@sss.pgh.pa.us> — 2019-11-24T17:06:26Z

    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
    
    
    
    
  6. RE: [PATCH] Style, remove redudant test "if (zeropadlen > 0)"

    Ranier VF <ranier_gyn@hotmail.com> — 2019-11-24T17:33:19Z

    >Could you please at least take the time to produce a patch that actually applies properly?
    Yes of course.
    Thank you.
    
    Ranier Vilela