Content-Length: 269481 | pFad | http://github.com/postgrespro/postgres/commit/e722846daf4a37797ee39bc8ca3e78a4ef437f51

22 Improve BackendXidGetPid() to only access allProcs on matching XID · postgrespro/postgres@e722846 · GitHub
Skip to content

Commit e722846

Browse files
committed
Improve BackendXidGetPid() to only access allProcs on matching XID
Compilers are able to optimize that, but it makes the code slightly more readable this way. Author: Zhao Junwang Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/CAEG8a3+i9gtqF65B+g_puVaCQuf0rZC-EMqMyEjGFJYOqUUWfA@mail.gmail.com
1 parent 8438a3f commit e722846

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-
int pgprocno = arrayP->pgprocnos[index];
3178-
PGPROC *proc = &allProcs[pgprocno];
3179-
31803177
if (other_xids[index] == xid)
31813178
{
3179+
int pgprocno = arrayP->pgprocnos[index];
3180+
PGPROC *proc = &allProcs[pgprocno];
3181+
31823182
result = proc->pid;
31833183
break;
31843184
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/e722846daf4a37797ee39bc8ca3e78a4ef437f51

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy