Re: [HACKERS] Replacing lfirst() with lfirst_node() appropriately in planner.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Replacing lfirst() with lfirst_node() appropriately in planner.c
Date
Msg-id 6963.1504641734@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Replacing lfirst() with lfirst_node() appropriately in planner.c  (Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>)
Responses Re: [HACKERS] Replacing lfirst() with lfirst_node() appropriately in planner.c
List pgsql-hackers
Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> writes:
> On Tue, Sep 5, 2017 at 4:02 PM, Jeevan Chalke
> <jeevan.chalke@enterprisedb.com> wrote:
>> Attached patch for replacing linitial() with linital_node() appropriately in
>> planner.c

> Ok. The patch looks good to me. It compiles and make check passes.
> Here are both the patches rebased on the latest sources.

LGTM, pushed.  I also changed a couple of places that left off any cast
of lfirst, eg:

-            List       *gset = lfirst(lc);
+            List       *gset = (List *) lfirst(lc);

While this isn't really harmful, it's not per prevailing style.

BTW, I think we *could* use "lfirst_node(List, ...)" in cases where
we know the list is supposed to be a list of objects rather than ints
or Oids.  I didn't do anything about that observation, though.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: [HACKERS] Fix performance of generic atomics
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] [Proposal] Allow users to specify multiple tables inVACUUM commands