mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 08:43:04 +01:00
refactor: Use SpanReader over DataStream
The mutable temporary strValue can be re-used to apply the obfuscation, which allows to avoid a redundant copy of the value.
This commit is contained in:
@@ -214,9 +214,9 @@ public:
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
DataStream ssValue{MakeByteSpan(*strValue)};
|
||||
std::span ssValue{MakeWritableByteSpan(*strValue)};
|
||||
m_obfuscation(ssValue);
|
||||
ssValue >> value;
|
||||
SpanReader{ssValue} >> value;
|
||||
} catch (const std::exception&) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user