mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
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:
@@ -71,6 +71,7 @@
|
|||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
|
#include <unordered_map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
@@ -4023,7 +4024,7 @@ NetworkOPsImp::getBookPage(
|
|||||||
Json::Value& jvOffers =
|
Json::Value& jvOffers =
|
||||||
(jvResult[jss::offers] = Json::Value(Json::arrayValue));
|
(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 uBookBase = getBookBase(book);
|
||||||
const uint256 uBookEnd = getQualityNext(uBookBase);
|
const uint256 uBookEnd = getQualityNext(uBookBase);
|
||||||
uint256 uTipIndex = uBookBase;
|
uint256 uTipIndex = uBookBase;
|
||||||
|
|||||||
Reference in New Issue
Block a user