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:
Nik Bougalis
2020-05-12 17:23:30 -07:00
committed by manojsdoshi
parent 9f91870b1c
commit 3936110c8d
2 changed files with 3 additions and 21 deletions

View File

@@ -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);
}