Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc77f6f5

Browse files
committed
Fix cases of discarding result from list API functions
Two cases violated list APIs by throwing away the return value. Whilethe code was technically correct, it relied on internal knowledge ofthe list implementation, and the code wasn't really gaining anythingthat way. It is planned to make this a compiler warning in thefuture, so just fix these cases by assigning the return valueproperly.Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://www.postgresql.org/message-id/flat/e3753562-99cd-b65f-5aca-687dfd1ec2fc@2ndquadrant.com
1 parentec29427 commitc77f6f5

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

‎src/backend/commands/lockcmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ LockViewRecurse(Oid reloid, LOCKMODE lockmode, bool nowait,
266266

267267
LockViewRecurse_walker((Node*)viewquery,&context);
268268

269-
(void)list_delete_last(context.ancestor_views);
269+
context.ancestor_views=list_delete_last(context.ancestor_views);
270270

271271
table_close(view,NoLock);
272272
}

‎src/backend/parser/analyze.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,8 +1475,7 @@ transformValuesClause(ParseState *pstate, SelectStmt *stmt)
14751475
Node*col= (Node*)lfirst(lc);
14761476
List*sublist=lfirst(lc2);
14771477

1478-
/* sublist pointer in exprsLists won't need adjustment */
1479-
(void)lappend(sublist,col);
1478+
sublist=lappend(sublist,col);
14801479
}
14811480
list_free(colexprs[i]);
14821481
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp