Skip to content
This repository was archived by the owner on May 14, 2022. It is now read-only.

Commit eeb7602

Browse files
committed
replace while loop with for loop
1 parent 52f3479 commit eeb7602

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ module.exports = function AsyncAppendOnlyLog(filename, opts) {
443443
compaction = null
444444
if (err) return cb(err)
445445
compactionProgress.set({ sizeDiff, percent: 1, done: true })
446-
while (waitingCompaction.length) waitingCompaction.shift()()
446+
for (let i = 0, n = waitingCompaction.length; i < n; ++i) {
447+
waitingCompaction[i]()
448+
}
449+
waitingCompaction.length = 0
447450
cb()
448451
})
449452
compaction.progress((stats) => {

0 commit comments

Comments
 (0)