diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-02-01 09:42:38 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-02-01 09:42:46 +0100 |
commit | ba39ffe938b906646fff6b0b570ffd011beb0516 (patch) | |
tree | 0440be49c192157ced2e2afec900de5aee7bcb34 /src/test/script_tests.cpp | |
parent | ba3d32715f985314eb1fdb006bfc4127f8d516a7 (diff) | |
parent | dfc01ccd73e1f12698278d467c241f398da9fc7d (diff) |
Merge bitcoin/bitcoin#26888: net: simplify the call to vProcessMsg.splice()
dfc01ccd73e1f12698278d467c241f398da9fc7d net: simplify the call to vProcessMsg.splice() (Vasil Dimov)
Pull request description:
At the time when
```cpp
pnode->vProcessMsg.splice(pnode->vProcessMsg.end(), pnode->vRecvMsg, pnode->vRecvMsg.begin(), it);
```
is called, `it` is certainly `pnode->vRecvMsg.end()` which makes the call equivalent to:
```cpp
pnode->vProcessMsg.splice(pnode->vProcessMsg.end(), pnode->vRecvMsg, pnode->vRecvMsg.begin(), pnode->vRecvMsg.end());
```
which is equivalent to:
```cpp
pnode->vProcessMsg.splice(pnode->vProcessMsg.end(), pnode->vRecvMsg);
```
Thus, use the latter. Further, maybe irrelevant, but the latter has constant complexity while the original code is `O(length of vRecvMsg)`.
ACKs for top commit:
theStack:
Code-review ACK dfc01ccd73e1f12698278d467c241f398da9fc7d
MarcoFalke:
review ACK dfc01ccd73e1f12698278d467c241f398da9fc7d 🐑
jonatack:
Light review ACK dfc01ccd73e1f12698278d467c241f398da9fc7d
Tree-SHA512: 9f4eb61d1caf4af9a61ba2f54b915fcfe406db62c58ab1ec42f736505b6792e9379a83d0458d6cc04f289edcec070b7c962f94a920ab51701c3cab103152866f
Diffstat (limited to 'src/test/script_tests.cpp')
0 files changed, 0 insertions, 0 deletions