File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
packages/firestore/src/api Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -925,22 +925,16 @@ export class QuerySnapshot<
925925
926926 // Construct the arrays of document data for the query.
927927 const bundledDocuments = bundleLoader . documents ;
928- const documentSet = new DocumentSet ( ) ;
929- const documentKeys = documentKeySet ( ) ;
930- for ( const bundledDocumet of bundledDocuments ) {
931- const document = fromDocument ( serializer , bundledDocumet . document ! ) ;
932- documentSet . add ( document ) ;
933- const documentPath = ResourcePath . fromString (
934- bundledDocumet . metadata . name !
935- ) ;
936- documentKeys . add ( new DocumentKey ( documentPath ) ) ;
937- }
938-
928+ let documentSet = new DocumentSet ( ) ;
929+ bundledDocuments . map ( bundledDocument => {
930+ const document = fromDocument ( serializer , bundledDocument . document ! ) ;
931+ documentSet = documentSet . add ( document ) ;
932+ } ) ;
939933 // Create a view snapshot of the query and documents.
940934 const viewSnapshot = ViewSnapshot . fromInitialDocuments (
941935 query ,
942936 documentSet ,
943- documentKeys ,
937+ documentKeySet ( ) /* Zero mutated keys signifies no pending writes. */ ,
944938 /* fromCache= */ false ,
945939 /* hasCachedResults= */ false
946940 ) ;
You can’t perform that action at this time.
0 commit comments