Commit b897b3a
committed
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 2b27273.1 parent 9b8aa09 commit b897b3a
1 file changed
+3
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
1184 | | - | |
1185 | 1183 | | |
1186 | 1184 | | |
1187 | | - | |
1188 | | - | |
1189 | | - | |
1190 | 1185 | | |
1191 | 1186 | | |
1192 | 1187 | | |
| |||
1218 | 1213 | | |
1219 | 1214 | | |
1220 | 1215 | | |
1221 | | - | |
| 1216 | + | |
1222 | 1217 | | |
1223 | 1218 | | |
1224 | 1219 | | |
| |||
1227 | 1222 | | |
1228 | 1223 | | |
1229 | 1224 | | |
1230 | | - | |
| 1225 | + | |
1231 | 1226 | | |
1232 | 1227 | | |
1233 | 1228 | | |
| |||
1260 | 1255 | | |
1261 | 1256 | | |
1262 | 1257 | | |
1263 | | - | |
| 1258 | + | |
1264 | 1259 | | |
1265 | 1260 | | |
1266 | 1261 | | |
| |||
0 commit comments