From: 盏一 <w@hidva.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: andres <andres@anarazel.de>
Subject: use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`
Date: Fri, 7 May 2021 00:30:13 +0800
Message-ID: <tencent_5624AA3B116B3D1C31CA9744@qq.com> (raw)
Hi,
Since we have introduced `pgxactoff` in [941697c3c1ae5d6ee153065adb96e1e63ee11224](https://github.com/postgres/postgres/commit/941697c3c1ae5d6ee153065adb96e1e63ee11224), and `pgxactoff` is always the index of `proc->pgprocno` in `procArray->pgprocnos`. So it seems that we could directly use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`? My thought is to replace
```c
for (index = 0; index < arrayP->numProcs; index++)
{
if (arrayP->pgprocnos[index] == proc->pgprocno)
{
/* ... */
}
}
```
with
```c
index = proc->pgxactoff;
/* ... */
```
I would appreciate your help.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: w@hidva.com, andres@anarazel.de
Subject: Re: use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`
In-Reply-To: <tencent_5624AA3B116B3D1C31CA9744@qq.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox