mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
reserve correctly when limit is numeric_limits::max() (#198)
This commit is contained in:
@@ -694,7 +694,10 @@ traverseOwnedNodes(
|
||||
auto currentIndex = rootIndex;
|
||||
|
||||
std::vector<ripple::uint256> keys;
|
||||
keys.reserve(limit);
|
||||
// Only reserve 2048 nodes when fetching all owned ledger objects. If there
|
||||
// are more, then keys will allocate more memory, which is suboptimal, but
|
||||
// should only occur occasionally.
|
||||
keys.reserve(std::min(std::uint32_t{2048}, limit));
|
||||
|
||||
auto start = std::chrono::system_clock::now();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user