Explorar o código

partially remove sorted set

cherylEnkidu %!s(int64=2) %!d(string=hai) anos
pai
achega
466a9c776a

+ 1 - 1
Firestore/core/src/core/view.cc

@@ -89,7 +89,7 @@ View::View(Query query, DocumentKeySet remote_documents)
 }
 
 ComparisonResult View::Compare(const Document& lhs, const Document& rhs) const {
-  return document_set_.comparator().Compare(lhs, rhs);
+  return DocumentComparator.Compare(lhs, rhs);
 }
 
 ViewDocumentChanges View::ComputeDocumentChanges(

+ 1 - 1
Firestore/core/src/local/memory_mutation_queue.h

@@ -90,7 +90,7 @@ class MemoryMutationQueue : public MutationQueue {
 
  private:
   using DocumentKeyReferenceSet =
-      immutable::SortedSet<DocumentKeyReference, DocumentKeyReference::ByKey>;
+      std::set<DocumentKeyReference, DocumentKeyReference::ByKey>;
 
   std::vector<model::MutationBatch> AllMutationBatchesWithIds(
       const std::set<model::BatchId>& batch_ids);

+ 2 - 2
Firestore/core/src/local/reference_set.h

@@ -82,9 +82,9 @@ class ReferenceSet {
  private:
   void RemoveReference(const DocumentKeyReference& reference);
 
-  immutable::SortedSet<DocumentKeyReference, DocumentKeyReference::ByKey>
+  std::set<DocumentKeyReference, DocumentKeyReference::ByKey>
       by_key_;
-  immutable::SortedSet<DocumentKeyReference, DocumentKeyReference::ById> by_id_;
+  std::set<DocumentKeyReference, DocumentKeyReference::ById> by_id_;
 };
 
 }  // namespace local

+ 1 - 1
Firestore/core/src/model/document_key_set.h

@@ -25,7 +25,7 @@ namespace firestore {
 namespace model {
 
 /** Convenience type for a set of keys, since they are so common. */
-using DocumentKeySet = immutable::SortedSet<DocumentKey>;
+using DocumentKeySet = std::set<DocumentKey, util::Comparator<DocumentKey>>;
 
 }  // namespace model
 }  // namespace firestore

+ 2 - 2
Firestore/core/src/model/document_set.h

@@ -57,7 +57,7 @@ class DocumentSet : public immutable::SortedContainer {
    * The type of the main collection of documents in an DocumentSet.
    * @see sorted_set_.
    */
-  using SetType = immutable::SortedSet<Document, DocumentComparator>;
+  using SetType = std::set<Document, DocumentComparator>;
 
   // STL container types
   using value_type = Document;
@@ -82,7 +82,7 @@ class DocumentSet : public immutable::SortedContainer {
   bool ContainsKey(const DocumentKey& key) const;
 
   const DocumentComparator& comparator() const {
-    return sorted_set_.comparator();
+    return DocumentComparator);
   }
 
   SetType::const_iterator begin() const {

+ 1 - 1
Firestore/core/src/model/model_fwd.h

@@ -93,7 +93,7 @@ using ListenSequenceNumber = int64_t;
 using TargetId = int32_t;
 
 using DocumentKeySet =
-    immutable::SortedSet<DocumentKey, util::Comparator<DocumentKey>>;
+    std::set<DocumentKey, util::Comparator<DocumentKey>, std::allocator<DocumentKey>>;
 
 using MutableDocumentMap = immutable::
     SortedMap<DocumentKey, MutableDocument, util::Comparator<DocumentKey>>;