We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adafd01 commit 40cdbccCopy full SHA for 40cdbcc
lib/parser.js
@@ -314,12 +314,11 @@ function parseType (parser, type) {
314
function decreaseBufferPool () {
315
if (bufferPool.length > 50 * 1024) {
316
if (counter === 1 || notDecreased > counter * 2) {
317
- const sliceLength = Math.floor(bufferPool.length / 10)
318
- if (bufferOffset <= sliceLength) {
319
- bufferOffset = 0
320
- } else {
321
- bufferOffset -= sliceLength
322
- }
+ const minSliceLen = Math.floor(bufferPool.length / 10)
+ const sliceLength = minSliceLen < bufferOffset
+ ? bufferOffset
+ : minSliceLen
+ bufferOffset = 0
323
bufferPool = bufferPool.slice(sliceLength, bufferPool.length)
324
} else {
325
notDecreased++
0 commit comments