Skip to content

Commit 1d581ce

Browse files
committed
Fix misuse of foreach_delete_current().
Our coding convention requires this macro's result to be assigned back to the original List variable. In this usage, since the List could not become empty, there was no actual bug --- but some compilers warned about it. Oversight in be45be9. Discussion: https://postgr.es/m/35077b31-2d62-1e31-0e2e-ddb52d590b73@enterprisedb.com
1 parent be45be9 commit 1d581ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/parser/parse_agg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,11 +1844,11 @@ expand_grouping_sets(List *groupingSets, bool groupDistinct, int limit)
18441844
list_sort(result, cmp_list_len_contents_asc);
18451845

18461846
/* Finally, remove duplicates */
1847-
prev = list_nth_node(List, result, 0);
1847+
prev = linitial_node(List, result);
18481848
for_each_from(cell, result, 1)
18491849
{
18501850
if (equal(lfirst(cell), prev))
1851-
foreach_delete_current(result, cell);
1851+
result = foreach_delete_current(result, cell);
18521852
else
18531853
prev = lfirst(cell);
18541854
}

0 commit comments

Comments
 (0)