Re: equal() perf tweak

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: equal() perf tweak
Дата
Msg-id 3623.1068056555@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: equal() perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
I said:
> No, lfirst and friends will need to apply to ListCells not to Lists,
> else the coding of foreach loops will break everywhere.  I think there
> are many more places that will want lfirst to apply to a ListCell than
> will want it to apply to a raw List.

On the other hand, we will need to touch every foreach loop anyway to
update the datatype of the iteration variable.  I can see merit in the
idea of *deliberately* breaking any un-updated code by means of removing
the lfirst and lnext macros completely.  If we go that path, we could
use names like

    nextcell(cl)        replaces lnext()
    cellvalue(cl)        replaces lfirst()
    cellvaluei(cl)        replaces lfirsti()
    cellvalueo(cl)        replaces lfirsto()

plus invent names like ListFirst(), ListSecond(), etc for the cases
where you really are fetching the n'th element of a List rather than
the contents of the current ListCell.

I'm not wedded to these particular naming suggestions, just thinking
that maybe backwards-compatibility of the macro names isn't such a hot
idea after all.  What do you think?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: equal() perf tweak
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: equal() perf tweak