Re: Some new list.c primitives
От | David Fetter |
---|---|
Тема | Re: Some new list.c primitives |
Дата | |
Msg-id | 20050728002532.GD6635@fetter.org обсуждение исходный текст |
Ответ на | Some new list.c primitives (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Some new list.c primitives
|
Список | pgsql-hackers |
On Wed, Jul 27, 2005 at 06:01:21PM -0400, Tom Lane wrote: > Neil (or anyone else with an opinion), > > I'm finding several uses in the planner for some new List primitives > defined as below. I'd like to push these into list.c, but before that, > has anyone got any serious objections? How about suggestions for better > names? > > regards, tom lane > > > > /* > * list_add adds the datum to the list if it's not already a member > * (membership is determined by equal()). > */ > static List * > list_add(List *list, void *datum) > { > if (list_member(list, datum)) > return list; > else > return lappend(list, datum); > } How about list_push for both of these? This opens the door for possible future functionality like list_pop, list_shift, list_unshift... Just my uneducated $.02. Cheers, D -- David Fetter david@fetter.org http://fetter.org/ phone: +1 510 893 6100 mobile: +1 415 235 3778 Remember to vote!
В списке pgsql-hackers по дате отправления: