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:
MarcoFalke committed 2026-02-06 07:56:57 +01:00
1 parent fad3eb3956
commit fa0677d131
23 files changed
+37 -60

No files matched your search

+1 -1
View File
@@ -365,7 +365,7 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
std::vector<std::string> requests = walletModel.wallet().getAddressReceiveRequests();
QCOMPARE(requests.size(), size_t{1});
RecentRequestEntry entry;
DataStream{MakeUCharSpan(requests[0])} >> entry;
SpanReader{MakeByteSpan(requests[0])} >> entry;
QCOMPARE(entry.nVersion, int{1});
QCOMPARE(entry.id, int64_t{1});
QVERIFY(entry.date.isValid());