Skip to content

Commit 05d5bc9

Browse files
shinyaaahackorum
authored andcommitted
Avoid recalculating pgprocno in ProcArrayAdd()
ProcArrayAdd() already calculates pgprocno via GetNumberFromPGProc() at the top of the function, but the assignment to arrayP->pgprocnos[index] redundantly called GetNumberFromPGProc() again instead of reusing the local variable. This was introduced in commit 28f3915. Author: Shinya Kato <shinya11.kato@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://postgr.es/m/CAOzEurTJO2aqd9ewQmo9vjCrFUAD8Lk+raujCfK5oWoLGUP_3w@mail.gmail.com
1 parent b597835 commit 05d5bc9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/backend/storage/ipc/procarray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ ProcArrayAdd(PGPROC *proc)
519519
&ProcGlobal->statusFlags[index],
520520
movecount * sizeof(*ProcGlobal->statusFlags));
521521

522-
arrayP->pgprocnos[index] = GetNumberFromPGProc(proc);
522+
arrayP->pgprocnos[index] = pgprocno;
523523
proc->pgxactoff = index;
524524
ProcGlobal->xids[index] = proc->xid;
525525
ProcGlobal->subxidStates[index] = proc->subxidStatus;

0 commit comments

Comments
 (0)