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

opt: opt judgment code of cancel #4587

Merged
merged 2 commits into from May 3, 2022
Merged

Conversation

zh-lx
Copy link
Contributor

@zh-lx zh-lx commented Apr 6, 2022

If !cancel is false, it means cancel is not false. So it can be optimized as follows:

reject(!cancel || cancel.type ? new CanceledError() : cancel);

close #4588

Copy link
Member

@jasonsaayman jasonsaayman left a comment

Looks good :)

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.

optimazition of code
2 participants