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:
@@ -91,7 +91,7 @@ public:
|
||||
Serializer s;
|
||||
for (int d = 0; d < 3; ++d)
|
||||
s.add32(ripple::rand_int<std::uint32_t>(r));
|
||||
return std::make_shared<Item>(s.getSHA512Half(), s.peekData());
|
||||
return std::make_shared<Item>(s.getSHA512Half(), s.slice());
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user