aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history/CountryHistory.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-10 00:04:30 +0200
committer GitHub <noreply@github.com>2024-09-10 00:04:30 +0200
commit7a9206e3869fbb659d296b854c90f5c81755a5ca (patch)
tree1e00781e634cbb7ea6f31343f6751f7755bd53ef /src/openvic-simulation/history/CountryHistory.cpp
parent79dbf71dd23623059ea9eabd87956f93604be1ed (diff)
parentd67cd2d08fe2859809e35b93f5a8358c48a3705e (diff)
Merge pull request #195 from OpenVicProject/ranking
Ranking System
Diffstat (limited to 'src/openvic-simulation/history/CountryHistory.cpp')
-rw-r--r--src/openvic-simulation/history/CountryHistory.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvic-simulation/history/CountryHistory.cpp b/src/openvic-simulation/history/CountryHistory.cpp
index 145d26b..04f6292 100644
--- a/src/openvic-simulation/history/CountryHistory.cpp
+++ b/src/openvic-simulation/history/CountryHistory.cpp
@@ -191,6 +191,10 @@ void CountryHistoryManager::reserve_more_country_histories(size_t size) {
}
void CountryHistoryManager::lock_country_histories() {
+ for (auto [country, history_map] : mutable_iterator(country_histories)) {
+ history_map.sort_entries();
+ }
+
Logger::info("Locked country history registry after registering ", country_histories.size(), " items");
locked = true;
}