aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/model
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-05-05 09:00:53 -0700
committerGravatar GitHub <noreply@github.com>2018-05-05 09:00:53 -0700
commit5af6de9e69b86ab94da78b9f889b96517cec47da (patch)
tree0b8447e1a4e921a38e568ad0aef6cb9aca1997b6 /Firestore/core/src/firebase/firestore/model
parenta080e481b5e6fcbc2b645920051cf20fc8cad7a7 (diff)
Migrate FSTDocumentVersionDictionary to C++ DocumentVersionMap (#1231)
Diffstat (limited to 'Firestore/core/src/firebase/firestore/model')
-rw-r--r--Firestore/core/src/firebase/firestore/model/document_key.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/Firestore/core/src/firebase/firestore/model/document_key.h b/Firestore/core/src/firebase/firestore/model/document_key.h
index 6532b2e..f6f4bf1 100644
--- a/Firestore/core/src/firebase/firestore/model/document_key.h
+++ b/Firestore/core/src/firebase/firestore/model/document_key.h
@@ -59,15 +59,15 @@ class DocumentKey {
return [FSTDocumentKey keyWithPath:path()];
}
- std::string ToString() const {
- return path().CanonicalString();
- }
-
NSUInteger Hash() const {
return util::Hash(ToString());
}
#endif
+ std::string ToString() const {
+ return path().CanonicalString();
+ }
+
/**
* Creates and returns a new document key using '/' to split the string into
* segments.
@@ -119,6 +119,12 @@ inline bool operator>=(const DocumentKey& lhs, const DocumentKey& rhs) {
return lhs.path() >= rhs.path();
}
+struct DocumentKeyHash {
+ size_t operator()(const DocumentKey& key) const {
+ return util::Hash(key.ToString());
+ }
+};
+
} // namespace model
namespace util {