use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`

Поиск
Список
Период
Сортировка
От 盏一
Тема use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`
Дата
Msg-id tencent_5624AA3B116B3D1C31CA9744@qq.com
обсуждение исходный текст
Ответы Re: use `proc->pgxactoff` as the value of `index` in `ProcArrayRemove()`
Список pgsql-hackers
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.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Small issues with CREATE TABLE COMPRESSION
Следующее
От: Isaac Morland
Дата:
Сообщение: Re: COPY table_name (single_column) FROM 'iso-8859-1.txt' DELIMITER E'\n'