Use an unordered map for the Realm coordinator cache

This commit is contained in:
Thomas Goyne 2015-11-23 14:45:33 -08:00
parent d6daa052e8
commit 7a0c83929f
1 changed files with 3 additions and 1 deletions

View File

@ -22,11 +22,13 @@
#include "external_commit_helper.hpp" #include "external_commit_helper.hpp"
#include "object_store.hpp" #include "object_store.hpp"
#include <unordered_map>
using namespace realm; using namespace realm;
using namespace realm::_impl; using namespace realm::_impl;
static std::mutex s_coordinator_mutex; static std::mutex s_coordinator_mutex;
static std::map<std::string, std::weak_ptr<RealmCoordinator>> s_coordinators_per_path; static std::unordered_map<std::string, std::weak_ptr<RealmCoordinator>> s_coordinators_per_path;
std::shared_ptr<RealmCoordinator> RealmCoordinator::get_coordinator(StringData path) std::shared_ptr<RealmCoordinator> RealmCoordinator::get_coordinator(StringData path)
{ {