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

Changed usage of CancellationToken #184

Merged
merged 1 commit into from
Nov 2, 2022
Merged

Changed usage of CancellationToken #184

merged 1 commit into from
Nov 2, 2022

Conversation

arkada38
Copy link
Contributor

@arkada38 arkada38 commented Jun 21, 2022

We can use
CancellationToken cancellationToken = default
instead of
CancellationToken? cancellationToken = null and cancellationToken ?? CancellationToken.None

using System.Diagnostics;
using System.Threading;
CancellationToken cancellationToken = default;
Debug.Assert(cancellationToken == CancellationToken.None);
CancellationToken? cancellationToken = null;
cancellationToken = CancellationToken.None;
Debug.Assert(cancellationToken == CancellationToken.None);

image

Copy link
Member

@chrissainty chrissainty left a comment

Choose a reason for hiding this comment

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

Thanks @arkada38, this is a nice improvement.

@chrissainty chrissainty merged commit 23d7b71 into Blazored:main Nov 2, 2022
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.

2 participants