Skip to content

Commit 1d9a684

Browse files
authored
Don't compare boolean with false (#45934)
Alternatively pattern matching `is false` could be used.
1 parent ea56e90 commit 1d9a684

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/whats-new/csharp-14.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static class Enumerable
3737
extension<TSource>(IEnumerable<TSource> source) // extension members for IEnumerable<TSource>
3838
{
3939
// Extension property:
40-
public bool IsEmpty => source.Any() == false;
40+
public bool IsEmpty => !source.Any();
4141
// Extension indexer:
4242
public TSource this[int index] => source.Skip(index).First();
4343

0 commit comments

Comments
 (0)