This replaces a spread call validDocs.push(...docs) where validDocs was empty with simple assignment validDocs = docs to avoid a stack overflow with a big docs array.
RangeError: Maximum call stack size exceeded
Spread calls use stack space, so foo.push(...REALLY_BIG_ARRAY) uses LOTS of stack space and it can easily cause a stack overflow.
This fix makes a lot of sense as there's no need to push to an empty array when you can just reassign it. Just thinking on optimizations it makes a lot of sense. How is it going @tex0l @arantes555
This replaces a spread call
validDocs.push(...docs)
wherevalidDocs
was empty with simple assignmentvalidDocs = docs
to avoid a stack overflow with a bigdocs
array.Spread calls use stack space, so
foo.push(...REALLY_BIG_ARRAY)
uses LOTS of stack space and it can easily cause a stack overflow.