We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
null
BenchmarkDotNet version: 0.13.9
My benchmark code:
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Running; BenchmarkRunner.Run<NullableEqualsBenchmarks>(); public class NullableEqualsBenchmarks { [Params(1, 0, null)] public int? Prop { get; set; } [Benchmark] public int CurrentLoweringNonDefault() { int? num = Prop; int num2 = 42; if ((num.GetValueOrDefault() == num2) & num.HasValue) { return 1; } return 0; } [Benchmark] public int ProposedLoweringNonDefault() { if (Prop.GetValueOrDefault() == 42) { return 1; } return 0; } [Benchmark] public int CurrentLoweringDefault() { int? num = Prop; int num2 = 0; if ((num.GetValueOrDefault() == num2) & num.HasValue) { return 1; } return 0; } [Benchmark] public int ProposedLoweringDefault() { if (Prop.GetValueOrDefault(1) == 0) { return 1; } return 0; } }
Result table after run:
I would expect null to be displayed in Prop column instead of meaningless ?s
Prop
?
The text was updated successfully, but these errors were encountered:
Should be fixed by #2122
Sorry, something went wrong.
YegorStepanov
Successfully merging a pull request may close this issue.
BenchmarkDotNet version: 0.13.9
My benchmark code:
Result table after run:
I would expect
null
to be displayed inProp
column instead of meaningless?
sThe text was updated successfully, but these errors were encountered: