mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Relax overly-strict assert in Serializer constructor (RIPD-1701):
The constructor would previously assert that the specified buffer pointer was non-null, even if the buffer size is specified as 0. While reasonable, this also makes it more difficult to use this API.
This commit is contained in:
committed by
Nik Bougalis
parent
76d5ecb595
commit
710f9ee1ac
@@ -51,12 +51,13 @@ public:
|
||||
|
||||
Serializer (void const* data, std::size_t size)
|
||||
{
|
||||
assert(!data == !size);
|
||||
|
||||
mData.resize(size);
|
||||
|
||||
if (size)
|
||||
{
|
||||
assert(data != nullptr);
|
||||
std::memcpy(mData.data(), data, size);
|
||||
}
|
||||
}
|
||||
|
||||
Slice slice() const noexcept
|
||||
|
||||
Reference in New Issue
Block a user