Use only Span{} constructor for byte-like types where possible

This removes bloat that is not needed.
This commit is contained in:
MarcoFalke
2023-06-22 17:02:28 +02:00
parent fa257bc831
commit fa38d86235
10 changed files with 23 additions and 23 deletions

View File

@@ -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();
}