-
Notifications
You must be signed in to change notification settings - Fork 11
FL0017
Dave Dunkin edited this page Oct 31, 2022
·
2 revisions
Avoid patterns such as:
var result = true switch
{
_ when someCondition => result1,
_ when someOtherCondition => result2,
_ => throw new InvalidOperationException(), // someCondition and someOtherCondition are actually mutually exclusive
}
Instead:
var result = someCondition ? result1 : result2;