aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/model/document_key.h
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/core/src/firebase/firestore/model/document_key.h')
-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 {