Skip to content

Commit

Permalink
Fix stack overflow by replacing spread w/ for loop
Browse files Browse the repository at this point in the history
Closes GH-15.

Reviewed-by: Christian Murphy <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
zzuu666 authored Jan 20, 2025
1 parent d7ae8b5 commit b9c47f5
Show file tree
Hide file tree
Showing 3 changed files with 160,067 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dev/lib/edit-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,16 @@ export class EditMap {
events.length = this.map[index][0]
}

vecs.push([...events])
vecs.push(events.slice())
events.length = 0

let slice = vecs.pop()

while (slice) {
events.push(...slice)
for (const element of slice) {
events.push(element)
}

slice = vecs.pop()
}

Expand Down
Loading

0 comments on commit b9c47f5

Please sign in to comment.