mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-08 05:39:38 +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:
@@ -13,10 +13,9 @@
|
||||
|
||||
FUZZ_TARGET(tx_in)
|
||||
{
|
||||
DataStream ds{buffer};
|
||||
CTxIn tx_in;
|
||||
try {
|
||||
ds >> tx_in;
|
||||
SpanReader{buffer} >> tx_in;
|
||||
} catch (const std::ios_base::failure&) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user