Merge pull request #4183 from overleaf/jpa-use-memory-views
[perf] serviceWorker: use memory view on large chunks instead of slicing GitOrigin-RevId: 10933b25500aebc0b236315aceca4c44089c79e6
This commit is contained in:
@@ -415,7 +415,7 @@ function processPdfRequest(
|
||||
if (offsetStart > 0 || offsetEnd > 0) {
|
||||
// compute index positions for slice to handle case where offsetEnd=0
|
||||
const chunkSize = chunk.end - chunk.start
|
||||
data = data.slice(offsetStart, chunkSize - offsetEnd)
|
||||
data = data.subarray(offsetStart, chunkSize - offsetEnd)
|
||||
}
|
||||
const insertPosition = Math.max(chunk.start - start, 0)
|
||||
reAssembledBlob.set(data, insertPosition)
|
||||
|
||||
Reference in New Issue
Block a user