mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Fix cases of discarding result from list API functions
Two cases violated list APIs by throwing away the return value. While the code was technically correct, it relied on internal knowledge of the list implementation, and the code wasn't really gaining anything that way. It is planned to make this a compiler warning in the future, so just fix these cases by assigning the return value properly. Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/e3753562-99cd-b65f-5aca-687dfd1ec2fc@2ndquadrant.com
This commit is contained in:
@ -1475,8 +1475,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
|
||||
Node *col = (Node *) lfirst(lc);
|
||||
List *sublist = lfirst(lc2);
|
||||
|
||||
/* sublist pointer in exprsLists won't need adjustment */
|
||||
(void) lappend(sublist, col);
|
||||
sublist = lappend(sublist, col);
|
||||
}
|
||||
list_free(colexprs[i]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user