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:
commit
aa3fc5844a
@ -349,7 +349,9 @@ class Page {
|
||||
);
|
||||
}
|
||||
|
||||
return Promise.all(newRefsPromises);
|
||||
return Promise.all(newRefsPromises).then(function (newRefs) {
|
||||
return newRefs.filter(newRef => !!newRef);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -629,11 +629,7 @@ class WorkerMessageHandler {
|
||||
return stream.bytes;
|
||||
}
|
||||
} else {
|
||||
for (const ref of refs) {
|
||||
newRefs = ref
|
||||
.filter(x => x !== null)
|
||||
.reduce((a, b) => a.concat(b), newRefs);
|
||||
}
|
||||
newRefs = refs.flat(2);
|
||||
|
||||
if (newRefs.length === 0) {
|
||||
// No new refs so just return the initial bytes
|
||||
|
Loading…
Reference in New Issue
Block a user