mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Reduce memory allocations for RCLCensorshipDetector
This commit is contained in:
committed by
Nik Bougalis
parent
08371ba2c4
commit
296469f5fe
@@ -33,7 +33,10 @@ class RCLCensorshipDetector_test : public beast::unit_test::suite
|
||||
std::vector<int> remain, std::vector<int> remove)
|
||||
{
|
||||
// Begin tracking what we're proposing this round
|
||||
cdet.propose(round, std::move(proposed));
|
||||
RCLCensorshipDetector<int, int>::TxIDSeqVec proposal;
|
||||
for (auto const& i : proposed)
|
||||
proposal.emplace_back(i, round);
|
||||
cdet.propose(std::move(proposal));
|
||||
|
||||
// Finalize the round, by processing what we accepted; then
|
||||
// remove anything that needs to be removed and ensure that
|
||||
@@ -68,7 +71,7 @@ public:
|
||||
|
||||
RCLCensorshipDetector<int, int> cdet;
|
||||
int round = 0;
|
||||
|
||||
// proposed accepted remain remove
|
||||
test(cdet, ++round, { }, { }, { }, { });
|
||||
test(cdet, ++round, { 10, 11, 12, 13 }, { 11, 2 }, { 10, 13 }, { });
|
||||
test(cdet, ++round, { 10, 13, 14, 15 }, { 14 }, { 10, 13, 15 }, { });
|
||||
|
||||
Reference in New Issue
Block a user