Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Trivial dead code removal: in makeObjectName(), name1 must be

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Trivial dead code removal: in makeObjectName(), name1 must be
Date: 2005-06-21 02:38:24
Message-ID: 19364.1119321504@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-committers
neilc(at)svr1(dot)postgresql(dot)org (Neil Conway) writes:
> Trivial dead code removal: in makeObjectName(), name1 must be non-NULL
> (due to the preceding strlen(), for example), so we needn't recheck this
> before invoking pg_mbcliplen().

I don't like either this change or the tab-complete one: this seems to
me to reduce readability, as well as robustness in the face of future
changes, in order to save nothing at all worth mentioning.  If these
were performance-critical paths it might be worth doing, but they are
not.  What's more, given a reasonably-intelligent optimizing compiler
the same deductions would be made at compile time, and so it's a fair
bet that you have bought not roughly but exactly zero in return for
making the code more fragile and less readable.

The schemacmds.c change seems OK since it's not introducing any obvious
path for future breakage.

			regards, tom lane

In response to

Responses

pgsql-committers by date

Next:From: Neil ConwayDate: 2005-06-21 02:49:33
Subject: Re: pgsql: Trivial dead code removal: in makeObjectName(),
Previous:From: Neil ConwayDate: 2005-06-21 01:23:26
Subject: pgsql: Fix a potential backend crash during authentication when parsing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group