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-24 08:59:38 -0700
committerGravatar GitHub <noreply@github.com>2018-04-24 08:59:38 -0700
commit8327390ccc27853c5bee794029a9ab2cc54df335 (patch)
treeb6a93e3613774b2228ea3d262cad566de62114e3 /Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
parent6dfc142888410ef6906970d8cb90f69c0992852a (diff)
Implement erase in C++ immutable maps (#1158)
* Add SortedMap::min * Add SortedMap::erase
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.h12
1 files changed, 12 insertions, 0 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 6ffe017..487a25a 100644
--- a/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
+++ b/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h
@@ -258,6 +258,18 @@ class ArraySortedMap : public SortedMapBase {
return found == end() ? npos : static_cast<size_type>(found - begin());
}
+ const_iterator min() const {
+ return begin();
+ }
+
+ const_iterator max() const {
+ if (empty()) {
+ return end();
+ }
+
+ return end() - 1;
+ }
+
/**
* Returns an iterator pointing to the first entry in the map. If there are
* no entries in the map, begin() == end().