Skip to content

Commit ff9f82d

Browse files
authored
Don't compare boolean with false
Alternatively pattern matching `is false` could be used.
1 parent 6753af2 commit ff9f82d

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)