mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Simplify SHAMapItem construction:
The existing class offered several constructors which were mostly unnecessary. This commit eliminates all existing constructors and introduces a single new one, taking a `Slice`. The internal buffer is switched from `std::vector` to `Buffer` to save a minimum of 8 bytes (plus the buffer slack that is inherent in `std::vector`) per SHAMapItem instance.
This commit is contained in:
@@ -28,7 +28,7 @@ SHAMapLeafNode::SHAMapLeafNode(
|
||||
std::uint32_t cowid)
|
||||
: SHAMapTreeNode(cowid), item_(std::move(item))
|
||||
{
|
||||
assert(item_->peekData().size() >= 12);
|
||||
assert(item_->size() >= 12);
|
||||
}
|
||||
|
||||
SHAMapLeafNode::SHAMapLeafNode(
|
||||
@@ -37,7 +37,7 @@ SHAMapLeafNode::SHAMapLeafNode(
|
||||
SHAMapHash const& hash)
|
||||
: SHAMapTreeNode(cowid, hash), item_(std::move(item))
|
||||
{
|
||||
assert(item_->peekData().size() >= 12);
|
||||
assert(item_->size() >= 12);
|
||||
}
|
||||
|
||||
std::shared_ptr<SHAMapItem const> const&
|
||||
|
||||
Reference in New Issue
Block a user