diff options
author | Tor Egge <Tor.Egge@yahooinc.com> | 2023-05-24 20:15:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 20:15:45 +0200 |
commit | 1d445d46f6c4662d64ff77c81b068163d4077479 (patch) | |
tree | c206b318eec2fd357388eb1118da2e1c9591436c | |
parent | 2a7349da19f5cccafa474b57d1e9b3c02117778e (diff) | |
parent | a424863dcf8661a7999fc0d985fa3868964707a0 (diff) |
Merge pull request #27211 from vespa-engine/balder/use-vespalib-hash_map
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; |