Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

fix: add buffer and cleanup #22

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: simplify mount query many
  • Loading branch information
hugomrdias committed Mar 31, 2020
commit 4687f054ebf0a10e88cde34c144552c3ec5c758e
12 changes: 3 additions & 9 deletions src/mount.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,9 @@ class MountDatastore {

function _many (iterable) {
return (async function * () {
const completed = iterable.map(() => false)
while (!completed.every(Boolean)) {
for (const [idx, itr] of iterable.entries()) {
const it = await itr.next()
if (it.done) {
completed[idx] = true
continue
}
yield it.value
for (let i = 0; i < iterable.length; i++) {
for await (const v of iterable[i]) {
yield v
}
}
})()
Expand Down