mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-07 14:18:18 +02:00
refactor: Use SpanReader over DataStream
This refactor does not change behavior. However, it avoids a vector copy, which can lead to a minimal speed-up of 1%-5%, depending on the call-site. This is mostly relevant for the fuzz tests and utils that read large blobs of data (like a full block).
This commit is contained in:
@@ -201,7 +201,7 @@ static std::vector<CAddress> ConvertSeeds(const std::vector<uint8_t> &vSeedsIn)
|
||||
const auto one_week{7 * 24h};
|
||||
std::vector<CAddress> vSeedsOut;
|
||||
FastRandomContext rng;
|
||||
ParamsStream s{DataStream{vSeedsIn}, CAddress::V2_NETWORK};
|
||||
ParamsStream s{SpanReader{vSeedsIn}, CAddress::V2_NETWORK};
|
||||
while (!s.empty()) {
|
||||
CService endpoint;
|
||||
s >> endpoint;
|
||||
|
||||
Reference in New Issue
Block a user