Re: unused code in float8_to_char , formatting.c ?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: unused code in float8_to_char , formatting.c ?
Дата
Msg-id 20131201020103.GH11181@momjian.us
обсуждение исходный текст
Ответ на Re: unused code in float8_to_char , formatting.c ?  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: unused code in float8_to_char , formatting.c ?
Список pgsql-hackers
On Sun, Apr  7, 2013 at 12:14:29AM -0400, Robert Haas wrote:
> On Thu, Apr 4, 2013 at 6:47 PM, Greg Jaskiewicz <gryzman@me.com> wrote:
> > Looking around the code Today, one of my helpful tools detected this dead code.
> > As far as I can see, it is actually unused call to strlen() in formatting.c, float8_to_char().
> 
> I poked at this a little and suggest the following somewhat more
> extensive cleanup.
> 
> It seems to me that there are a bunch of these functions where len is
> unconditionally initialized in NUM_TOCHAR_prepare and then used there.
>  Similarly in NUM_TOCHAR_cleanup.  And then there's a chunk of each
> individual function that does it a third time.  Rather than use the
> same variable in all three places, I've moved the variable
> declarations to the innermost possible scope.  Doing that revealed a
> bunch of other, similar places where we can get rid of strlen() calls.
> 
> Does this version seem like a good idea?

Robert, were you going to apply this patch from April?

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + Everyone has their own god. +



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [GENERAL] pg_upgrade ?deficiency
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Extension Templates S03E11