mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-13 22:24:05 +01:00
Use only Span{} constructor for byte-like types where possible
This removes bloat that is not needed.
This commit is contained in:
@@ -142,14 +142,14 @@ public:
|
||||
{
|
||||
unsigned int len = size();
|
||||
::WriteCompactSize(s, len);
|
||||
s.write(AsBytes(Span{vch, len}));
|
||||
s << Span{vch, len};
|
||||
}
|
||||
template <typename Stream>
|
||||
void Unserialize(Stream& s)
|
||||
{
|
||||
const unsigned int len(::ReadCompactSize(s));
|
||||
if (len <= SIZE) {
|
||||
s.read(AsWritableBytes(Span{vch, len}));
|
||||
s >> Span{vch, len};
|
||||
if (len != size()) {
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user