From 4c18f330c2c7de8eb644a51d7c130d1706c22edd Mon Sep 17 00:00:00 2001 From: Alexander Emelin Date: Thu, 27 Jun 2024 18:48:30 +0300 Subject: [PATCH] fix max call stack exceeded when applying fossil delta (#293) --- src/fossil.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fossil.ts b/src/fossil.ts index 006e1da0..f6dc4bbe 100644 --- a/src/fossil.ts +++ b/src/fossil.ts @@ -72,7 +72,8 @@ class Writer { // Copy from array at start to end. putArray(a: ByteArray, start: number, end: number) { - this.a.push(...a.slice(start, end)); + // TODO: optimize. + for (let i = start; i < end; i++) this.a.push(a[i]); } }