Skip to content

Commit

Permalink
better readline impl
Browse files Browse the repository at this point in the history
  • Loading branch information
ABevier authored and mxcl committed Mar 28, 2023
1 parent 6f890dc commit 4046576
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/vendor/Path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,10 @@ export default class Path {

async *readLines(): AsyncIterableIterator<string> {
const fd = Deno.openSync(this.string)
const lines = readLines(fd)
try {
while (true) {
const res = await lines.next()
if (res.done) {
break
}
yield res.value
for await (const line of readLines(fd))
yield line
}
}
finally {
fd.close()
}
Expand Down

0 comments on commit 4046576

Please sign in to comment.