Re: Duplicated assignment of slot_name in walsender.c

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Euler Taveira <euler@timbira.com.br>
Cc: Bernd Helmle <mailings@oopsware.de>, pgsql-hackers@postgresql.org
Date: 2015-10-21T20:21:25Z
Lists: pgsql-hackers
Euler Taveira wrote:

> It seems that the 2nd assignment was an oversight. Spotted by Bernd
> Helmle.

I think the first assignment is also pointless -- I mean can't we just
use MyReplicationSlot->data.name in both places where slot_name is used?

In the same routine, it seems wasteful to be doing strlen() twice for
every string sent over the wire.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. Measure string lengths only once