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.
This commit is contained in:
Nik Bougalis
2021-11-08 15:38:53 -08:00
parent 5d44998368
commit fae9f9b24b

View File

@@ -71,6 +71,7 @@
#include <mutex>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
namespace ripple {
@@ -4023,7 +4024,7 @@ NetworkOPsImp::getBookPage(
Json::Value& jvOffers =
(jvResult[jss::offers] = Json::Value(Json::arrayValue));
std::map<AccountID, STAmount> umBalance;
std::unordered_map<AccountID, STAmount> umBalance;
const uint256 uBookBase = getBookBase(book);
const uint256 uBookEnd = getQualityNext(uBookBase);
uint256 uTipIndex = uBookBase;