From: | José Luis Tallón <jltallon(at)adv-solutions(dot)net> |
---|---|
To: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andres Freund <andres(at)anarazel(dot)de> |
Cc: | Euler Taveira <euler(at)timbira(dot)com(dot)br>, Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Duplicated assignment of slot_name in walsender.c |
Date: | 2015-10-22 12:48:16 |
Message-ID: | 5628DB10.1000603@adv-solutions.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Thom Brown | 2015-10-22 13:33:11 | Re: Patch (2): Implement failover on libpq connect level. |
Previous Message | Michael Paquier | 2015-10-22 11:48:22 | Re: [PATCH v3] GSSAPI encryption support |