Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toAsyncIterable: Remove unnecessary EOF check #3914

Merged
merged 1 commit into from
Feb 7, 2020
Merged

toAsyncIterable: Remove unnecessary EOF check #3914

merged 1 commit into from
Feb 7, 2020

Conversation

braddunbar
Copy link
Contributor

@braddunbar braddunbar commented Feb 7, 2020

In #2335 a conditional was added to make sure toAsyncIterator didn't skip chunks because the reader returned data and EOF in a single call, fixing #2330.

Later, in #2591, the Reader interface changed to Promise<number | EOF>. Since the reader can no longer return data and EOF in a single call, this conditional is no longer necessary. We can just return { done: true, … } when we get EOF.

Thanks @satchmorun for digging into this with me!

In #2335 a conditional was added to make sure
toAsyncIterator didn't skip chunks because the reader returned data and
EOF in a single call, fixing #2330.

Later, in #2591, the `Reader` interface changed to
`Promise<number | EOF>`. Since the reader no longer returns data and EOF
in a single call, this conditional is not necessary. We can just return
`{ done: true }` when we get `EOF`.

Co-authored-by: Arun Srinivasan <[email protected]>
@claassistantio
Copy link

claassistantio commented Feb 7, 2020

CLA assistant check)
All committers have signed the CLA.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - LGTM - thanks

@ry ry merged commit d7edf39 into denoland:master Feb 7, 2020
@braddunbar braddunbar deleted the to-async-iterator-eof branch February 8, 2020 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants