Re: Duplicated assignment of slot_name in walsender.c - Mailing list pgsql-hackers

From José Luis Tallón
Subject Re: Duplicated assignment of slot_name in walsender.c
Date
Msg-id 5628DB10.1000603@adv-solutions.net
Whole thread Raw
In response to Re: Duplicated assignment of slot_name in walsender.c  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On 10/22/2015 12:36 AM, Alvaro Herrera wrote:
> Andres Freund wrote:
>
>> That seems fairly insignificant. For one this is a rather infrequent and
>> expensive operation, for another every decent compiler can optimize
>> those away. Note that those duplicate strlen() calls are there in a lot
>> of places in walsender.c
> diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
> index c6043cd..5487cc0 100644
> --- a/src/backend/replication/walsender.c
> +++ b/src/backend/replication/walsender.c
> @@ -762,10 +762,10 @@ logical_read_xlog_page(XLogReaderState *state, XLogRecPtr targetPagePtr, int req
>   static void
>   CreateReplicationSlot(CreateReplicationSlotCmd *cmd)
>   {
> -    const char *slot_name;
>       const char *snapshot_name = NULL;
>       char        xpos[MAXFNAMELEN];
>       StringInfoData buf;
> +    int            len;

Surely    "size_t len" ?
Or am I missing some platform where size_t is not defined ?
    Minor nitpicking, of course. But once we are cleaning the code up, 
might as well change this too....


Thanks!
    / J.L.




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [PATCH v3] GSSAPI encryption support
Next
From: Thom Brown
Date:
Subject: Re: Patch (2): Implement failover on libpq connect level.