Merge pull request #15062 from Snuffleupagus/save-newRefs

Simplify the `newRefs` computation in the "SaveDocument"-handler in the worker-thread
This commit is contained in:
Jonas Jenwald 2022-06-20 22:18:43 +02:00 committed by GitHub
commit aa3fc5844a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -349,7 +349,9 @@ class Page {
); );
} }
return Promise.all(newRefsPromises); return Promise.all(newRefsPromises).then(function (newRefs) {
return newRefs.filter(newRef => !!newRef);
});
}); });
} }

View File

@ -629,11 +629,7 @@ class WorkerMessageHandler {
return stream.bytes; return stream.bytes;
} }
} else { } else {
for (const ref of refs) { newRefs = refs.flat(2);
newRefs = ref
.filter(x => x !== null)
.reduce((a, b) => a.concat(b), newRefs);
}
if (newRefs.length === 0) { if (newRefs.length === 0) {
// No new refs so just return the initial bytes // No new refs so just return the initial bytes