diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-24 16:56:46 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-05-24 16:56:46 +0000 |
commit | a424863dcf8661a7999fc0d985fa3868964707a0 (patch) | |
tree | 14b24d3cfbf72255f6a2b5aeec910e5afbff65e3 | |
parent | c188bfa3d033adbb48f444ebbbe825037d9de8c8 (diff) |
Use vespalib::hash_map over std::unordered_map
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp | 2 | ||||
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp index 376c84c12d6..cb05ac7e9f8 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp +++ b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.cpp @@ -31,7 +31,7 @@ ImportedAttributesContext::getOrCacheAttribute(const vespalib::string &name, Att } else { metaGuard = metaItr->second; } - auto insRes = attributes.emplace(name, result->makeReadGuard(std::move(metaGuard), stableEnumGuard)); + auto insRes = attributes.insert(std::make_pair(name, result->makeReadGuard(std::move(metaGuard), stableEnumGuard))); return insRes.first->second->attribute(); } else { return nullptr; diff --git a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.h b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.h index 69f566b70a6..a90012a6ef8 100644 --- a/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.h +++ b/searchcore/src/vespa/searchcore/proton/attribute/imported_attributes_context.h @@ -33,7 +33,7 @@ private: using IAttributeFunctor = search::attribute::IAttributeFunctor; using MetaStoreReadGuard = search::IDocumentMetaStoreContext::IReadGuard; - using AttributeCache = std::unordered_map<vespalib::string, std::unique_ptr<AttributeReadGuard>, vespalib::hash<vespalib::string>>; + using AttributeCache = vespalib::hash_map<vespalib::string, std::unique_ptr<AttributeReadGuard>>; using MetaStoreCache = std::unordered_map<const void *, std::shared_ptr<MetaStoreReadGuard>>; using LockGuard = std::lock_guard<std::mutex>; @@ -41,7 +41,7 @@ private: mutable AttributeCache _guardedAttributes; mutable AttributeCache _enumGuardedAttributes; mutable MetaStoreCache _metaStores; - mutable std::mutex _cacheMutex; + mutable std::mutex _cacheMutex; const IAttributeVector *getOrCacheAttribute(const vespalib::string &name, AttributeCache &attributes, bool stableEnumGuard, const LockGuard &) const; |