aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-04-17 14:47:45 -0700
committerGravatar GitHub <noreply@github.com>2018-04-17 14:47:45 -0700
commit9329e6e09bed6925b3292aa05fea28e2bcd4d9ef (patch)
tree2d14ffa8d4087886e2842d678d7b27130868c302 /Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
parent1c44352889f4a48ddb5e7a586e6a9d1eef41193d (diff)
Implement TreeSortedMap::insert (#1081)
* Make LlrbNode Rep more explicit, share empty node * SortedMap::insert converts implementations * Implement LlrbNode::insert * Remove TestPolicy<SortedMap>
Diffstat (limited to 'Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h')
-rw-r--r--Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h b/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
index 92fd823..adba962 100644
--- a/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
+++ b/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
@@ -26,6 +26,7 @@
#include "Firestore/core/src/firebase/firestore/immutable/map_entry.h"
#include "Firestore/core/src/firebase/firestore/immutable/sorted_map_base.h"
+#include "Firestore/core/src/firebase/firestore/util/comparison.h"
#include "Firestore/core/src/firebase/firestore/util/firebase_assert.h"
namespace firebase {
@@ -118,7 +119,7 @@ class FixedArray {
* ArraySortedMap is a value type containing a map. It is immutable, but has
* methods to efficiently create new maps that are mutations of it.
*/
-template <typename K, typename V, typename C = std::less<K>>
+template <typename K, typename V, typename C = util::Comparator<K>>
class ArraySortedMap : public SortedMapBase {
public:
using key_comparator_type = KeyComparator<K, V, C>;
@@ -229,6 +230,10 @@ class ArraySortedMap : public SortedMapBase {
}
}
+ const key_comparator_type& comparator() const {
+ return key_comparator_;
+ }
+
/** Returns true if the map contains no elements. */
bool empty() const {
return size() == 0;