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

Commit2b16208

Browse files
committed
Fix ILIST_DEBUG build
Inc8ad4d8 dlist_member_check()'s arguments were made const. Unfortunatelythe implementation of dlist_member_check() used dlist_foreach(), whichcurrently doesn't work for const lists.As a workaround, open-code the list iteration. The other check functionsalready do so.Discussion:https://postgr.es/m/20230118182214.co7dp4oahiunwg57@awork3.anarazel.de
1 parent47bb9db commit2b16208

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/backend/lib/ilist.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,12 @@ slist_delete(slist_head *head, const slist_node *node)
5959
void
6060
dlist_member_check(constdlist_head*head,constdlist_node*node)
6161
{
62-
dlist_iteriter;
62+
constdlist_node*cur;
6363

64-
dlist_foreach(iter,head)
64+
/* iteration open-coded to due to the use of const */
65+
for (cur=head->head.next;cur!=&head->head;cur=cur->next)
6566
{
66-
if (iter.cur==node)
67+
if (cur==node)
6768
return;
6869
}
6970
elog(ERROR,"double linked list member check failure");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp