mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-21 03:26:01 +00:00
Avoid excessive resizing.
This commit is contained in:
@@ -309,6 +309,7 @@ void ValidationCollection::doWrite(Job&)
|
|||||||
while (!mStaleValidations.empty())
|
while (!mStaleValidations.empty())
|
||||||
{
|
{
|
||||||
std::vector<SerializedValidation::pointer> vector;
|
std::vector<SerializedValidation::pointer> vector;
|
||||||
|
vector.reserve(512);
|
||||||
mStaleValidations.swap(vector);
|
mStaleValidations.swap(vector);
|
||||||
sl.unlock();
|
sl.unlock();
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ protected:
|
|||||||
boost::shared_ptr<ValidationSet> findSet(const uint256& ledgerHash);
|
boost::shared_ptr<ValidationSet> findSet(const uint256& ledgerHash);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false) { ; }
|
ValidationCollection() : mValidations("Validations", 128, 600), mWriting(false)
|
||||||
|
{ mStaleValidations.reserve(512); }
|
||||||
|
|
||||||
bool addValidation(SerializedValidation::ref);
|
bool addValidation(SerializedValidation::ref);
|
||||||
ValidationSet getValidations(const uint256& ledger);
|
ValidationSet getValidations(const uint256& ledger);
|
||||||
|
|||||||
Reference in New Issue
Block a user