mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +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:
@@ -25,6 +25,7 @@
|
||||
#include <ripple/app/ledger/impl/LedgerDeltaAcquire.h>
|
||||
#include <ripple/app/ledger/impl/LedgerReplayMsgHandler.h>
|
||||
#include <ripple/app/ledger/impl/SkipListAcquire.h>
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/overlay/PeerSet.h>
|
||||
#include <ripple/overlay/impl/PeerImp.h>
|
||||
#include <test/jtx.h>
|
||||
@@ -1276,7 +1277,11 @@ struct LedgerReplayer_test : public beast::unit_test::suite
|
||||
InboundLedger::Reason::GENERIC, finalHash, totalReplay);
|
||||
|
||||
auto skipList = net.client.findSkipListAcquire(finalHash);
|
||||
auto item = std::make_shared<SHAMapItem>(uint256(12345), Blob(55, 55));
|
||||
|
||||
std::uint8_t payload[55] = {
|
||||
0x6A, 0x09, 0xE6, 0x67, 0xF3, 0xBC, 0xC9, 0x08, 0xB2};
|
||||
auto item = std::make_shared<SHAMapItem>(
|
||||
uint256(12345), Slice(payload, sizeof(payload)));
|
||||
skipList->processData(l->seq(), item);
|
||||
|
||||
std::vector<TaskStatus> deltaStatuses;
|
||||
|
||||
Reference in New Issue
Block a user