summaryrefslogtreecommitdiff
path: root/src/mongo/bson
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2018-11-30 11:14:16 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2018-12-20 09:18:05 -0500
commit6b641e86656df78e9f7ad2f364dec35e19df332e (patch)
treedb8f5ae4deb29e82d63b6f653eb7632d2b66b22b /src/mongo/bson
parentfc1aa5592b8783dc802668659ec87826d789dd2f (diff)
downloadmongo-6b641e86656df78e9f7ad2f364dec35e19df332e.tar.gz
SERVER-38249 Implement stdx unordered_map and unordered_set as absl node hash map/set.
Remove stdx::unordered_multimap and multiset. Custom hashers to stdx::unordered_map are not trusted by default, we will rehash the produced hash with absl again to ensure we have a good hash function.
Diffstat (limited to 'src/mongo/bson')
-rw-r--r--src/mongo/bson/simple_bsonobj_comparator.h16
-rw-r--r--src/mongo/bson/simple_bsonobj_comparator_test.cpp15
2 files changed, 0 insertions, 31 deletions
diff --git a/src/mongo/bson/simple_bsonobj_comparator.h b/src/mongo/bson/simple_bsonobj_comparator.h
index 90183beadf5..24ef6ecfbdf 100644
--- a/src/mongo/bson/simple_bsonobj_comparator.h
+++ b/src/mongo/bson/simple_bsonobj_comparator.h
@@ -113,13 +113,6 @@ using SimpleBSONObjUnorderedSet =
stdx::unordered_set<BSONObj, SimpleBSONObjComparator::Hasher, SimpleBSONObjComparator::EqualTo>;
/**
- * An unordered_multiset of BSONObjs that performs equality checks using simple binary semantics.
- */
-using SimpleBSONObjUnorderedMultiset = stdx::unordered_multiset<BSONObj,
- SimpleBSONObjComparator::Hasher,
- SimpleBSONObjComparator::EqualTo>;
-
-/**
* A map keyed on BSONObj that performs comparisons with simple binary semantics.
*/
template <typename T>
@@ -138,13 +131,4 @@ template <typename T>
using SimpleBSONObjUnorderedMap = stdx::
unordered_map<BSONObj, T, SimpleBSONObjComparator::Hasher, SimpleBSONObjComparator::EqualTo>;
-/**
- * An unordered_multimap keyed on BSONObj that performs equality checks using simple binary
- * semantics.
- */
-template <typename T>
-using SimpleBSONObjUnorderedMultiMap = stdx::unordered_multimap<BSONObj,
- T,
- SimpleBSONObjComparator::Hasher,
- SimpleBSONObjComparator::EqualTo>;
} // namespace mongo
diff --git a/src/mongo/bson/simple_bsonobj_comparator_test.cpp b/src/mongo/bson/simple_bsonobj_comparator_test.cpp
index ca94968a483..a6d9ab85631 100644
--- a/src/mongo/bson/simple_bsonobj_comparator_test.cpp
+++ b/src/mongo/bson/simple_bsonobj_comparator_test.cpp
@@ -86,14 +86,6 @@ TEST(SimpleBSONObjContainerTest, UnorderedSetIsDefaultConstructible) {
ASSERT_EQ(uset.size(), 2UL);
}
-TEST(SimpleBSONObjContainerTest, UnorderedMultiSetIsDefaultConstructible) {
- SimpleBSONObjUnorderedMultiset umultiset;
- umultiset.insert(BSON("x" << 1));
- umultiset.insert(BSON("x" << 1));
- umultiset.insert(BSON("y" << 1));
- ASSERT_EQ(umultiset.size(), 3UL);
-}
-
/**
* Asserts that the key-value pair 'pair' can be successfully inserted into 'map'.
*/
@@ -141,12 +133,5 @@ TEST(SimpleBSONObjContainerTest, UnorderedMapIsDefaultConstructible) {
ASSERT_EQ(umap.size(), 2UL);
}
-TEST(SimpleBSONObjContainerTest, UnorderedMultiMapIsDefaultConstructible) {
- SimpleBSONObjUnorderedMultiMap<std::string> umultimap;
- umultimap.insert(std::make_pair(BSON("_id" << 0), "anica"));
- umultimap.insert(std::make_pair(BSON("_id" << 0), "raj"));
- umultimap.insert(std::make_pair(BSON("_id" << 1), "ian"));
- ASSERT_EQ(umultimap.size(), 3UL);
-}
} // namespace
} // namespace mongo