Re: Simplify formatting.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Simplify formatting.c
Дата
Msg-id 28031.1214096047@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Simplify formatting.c  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Simplify formatting.c
Список pgsql-patches
Bruce Momjian <bruce@momjian.us> writes:
> The third step is for oracle_compat.c::initcap() to use
> formatting.c::str_initcap().  You can see the result;  patch attached
> (not applied).

> This greatly reduces the size of initcap(), with the downside that we
> are making two extra copies of the string to convert it to/from char*.

> Is this acceptable?

I'd say not.  Can't we do some more refactoring and avoid so many
useless conversions?  Seems like str_initcap is the wrong primitive API
--- the work ought to be done by a function that takes a char pointer
and a length.  That would be a suitable basis for functions operating
on both text datums and C strings.

(Perhaps what I should be asking is whether the performance of upper()
and lower() is equally bad.  Certainly all three should have comparable
code, so maybe they all need refactoring.)

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Simplify formatting.c
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Simplify formatting.c