Re: POC: converting Lists into arrays

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: POC: converting Lists into arrays
Дата
Msg-id 20190731230403.ytizwaji7gvof7x3@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: POC: converting Lists into arrays  (Andres Freund <andres@anarazel.de>)
Ответы Re: POC: converting Lists into arrays  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
Hi,

On 2019-07-31 16:00:47 -0700, Andres Freund wrote:
> On 2019-07-31 15:57:56 -0700, Andres Freund wrote:
> > I also wonder if a foreach version that includes the typical
> > (Type *) var = (Type *) lfirst(lc);
> > or
> > (Type *) var = castNode(Type, lfirst(lc));
> > or
> > OpExpr       *hclause = lfirst_node(OpExpr, lc);
> > 
> > would make it nicer to use lists.
> > 
> > foreach_node_in(Type, name, list) could mean something like
> > 
> > foreach(ListCell *name##_cell, list)
> > {
> >     Type* name = lfirst_node(Type, name##_cell);
> > }
> 
> s/lfirst/linitial/ of course. Was looking at code that also used
> lfirst...

Bullshit, of course.

/me performs a tactical withdrawal into his brown paper bag.


> Reminds me that one advantage of macros like the second one would also
> be to reduce the use of the confusingly named linitial*(), helping newer
> hackers.

But that point just had two consecutive embarassing demonstrations...

- Andres



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: POC: converting Lists into arrays
Следующее
От: Petr Jelinek
Дата:
Сообщение: Re: POC: converting Lists into arrays