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

Making ifSecond parameter as optional on Task Option.MatchAsync #164

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

vaclavpacholik
Copy link
Contributor

Let's make the second parameter optional to avoid forcing developers to specify the second function that does nothing

e.g.:

await myOption.MatchAsync(async r =>
    {
        await something...
        //do something else
    },
    _ => Task.CompletedTask
);

=>

await myOption.MatchAsync(async r =>
{
    await something...
    //do something else
});

Benchmark results:
.NET 6
image
.NET 8
image

@VaclavKucera VaclavKucera merged commit 1abf800 into master Feb 7, 2024
3 checks passed
@VaclavKucera VaclavKucera deleted the MatchAsync_ifSecond_as_Optional branch February 7, 2024 15:53
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