nbtree: Remove useless local variables.
authorPeter Geoghegan <pg@bowt.ie>
Wed, 18 Mar 2020 01:39:26 +0000 (18:39 -0700)
committerPeter Geoghegan <pg@bowt.ie>
Wed, 18 Mar 2020 01:39:26 +0000 (18:39 -0700)
commitb897b3aae6b525922fe3d074d4bdf5f2674954dd
tree072e3e07882d59eabfdab2c4d445bc5f990f758e
parent9b8aa0929390aab1f2f0859016e6110d283732dd
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.
src/backend/access/nbtree/nbtinsert.c