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; |               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
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user