mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Use boost::circular_buffer:
The existing code used std::deque along with a size check to constrain the size of a buffer and, effectively, "hand rolled" a circular buffer. This change simply migrates directly to boost::circular_buffer.
This commit is contained in:
committed by
manojsdoshi
parent
9f91870b1c
commit
3936110c8d
@@ -1961,9 +1961,6 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMHaveTransactionSet> const& m)
|
||||
return;
|
||||
}
|
||||
|
||||
if (recentTxSets_.size() == 128)
|
||||
recentTxSets_.pop_front();
|
||||
|
||||
recentTxSets_.push_back(hash);
|
||||
}
|
||||
}
|
||||
@@ -2324,11 +2321,6 @@ PeerImp::addLedger(
|
||||
recentLedgers_.end())
|
||||
return;
|
||||
|
||||
// VFALCO TODO See if a sorted vector would be better.
|
||||
|
||||
if (recentLedgers_.size() == 128)
|
||||
recentLedgers_.pop_front();
|
||||
|
||||
recentLedgers_.push_back(hash);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user