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

Commite722846

Browse files
committed
Improve BackendXidGetPid() to only access allProcs on matching XID
Compilers are able to optimize that, but it makes the code slightly morereadable this way.Author: Zhao JunwangReviewed-by: Ashutosh BapatDiscussion:https://postgr.es/m/CAEG8a3+i9gtqF65B+g_puVaCQuf0rZC-EMqMyEjGFJYOqUUWfA@mail.gmail.com
1 parent8438a3f commite722846

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3174,11 +3174,11 @@ BackendXidGetPid(TransactionId xid)
31743174

31753175
for (index=0;index<arrayP->numProcs;index++)
31763176
{
3177-
intpgprocno=arrayP->pgprocnos[index];
3178-
PGPROC*proc=&allProcs[pgprocno];
3179-
31803177
if (other_xids[index]==xid)
31813178
{
3179+
intpgprocno=arrayP->pgprocnos[index];
3180+
PGPROC*proc=&allProcs[pgprocno];
3181+
31823182
result=proc->pid;
31833183
break;
31843184
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp