pgsql: nbtree: Remove useless local variables.

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема pgsql: nbtree: Remove useless local variables.
Дата
Msg-id E1jENgQ-0003BF-63@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
nbtree: Remove useless local variables.

Copying block and offset numbers to local variables in _bt_insertonpg()
made the code less readable.  Remove the variables.  There is already
code that conditionally calls BufferGetBlockNumber() in the same block,
so consistently do it that way instead.

Calling BufferGetBlockNumber() is very cheap, but we might as well avoid
it when it isn't truly necessary.  It isn't truly necessary for
_bt_insertonpg() to call BufferGetBlockNumber() in almost all cases.

Spotted while working on a patch that refactors the fastpath rightmost
leaf page cache optimization, which was added by commit 2b272734.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/b897b3aae6b525922fe3d074d4bdf5f2674954dd

Modified Files
--------------
src/backend/access/nbtree/nbtinsert.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)


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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: pgsql: Add kqueue(2) support to the WaitEventSet API.
Следующее
От: Amit Kapila
Дата:
Сообщение: pgsql: Assert that we don't acquire a heavyweight lock on another objec