From fae9f9b24bf943242b6a1d496c132e5c516e6903 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Mon, 8 Nov 2021 15:38:53 -0800 Subject: [PATCH] Use unordered map for handling book_offers: The performance characteristics of `std::unordered_map` are better than `std::map` and the former should be preferred when the strict ordering of the latter is not required. --- src/ripple/app/misc/NetworkOPs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 1b3fcd1de..3e36fa27b 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -71,6 +71,7 @@ #include #include #include +#include #include namespace ripple { @@ -4023,7 +4024,7 @@ NetworkOPsImp::getBookPage( Json::Value& jvOffers = (jvResult[jss::offers] = Json::Value(Json::arrayValue)); - std::map umBalance; + std::unordered_map umBalance; const uint256 uBookBase = getBookBase(book); const uint256 uBookEnd = getQualityNext(uBookBase); uint256 uTipIndex = uBookBase;