Skip to content

Commit

Permalink
Replace IEnumerable.Count() with .Any() (#120)
Browse files Browse the repository at this point in the history
* Replace IEnumerable.Count() with .Any(). Remove unnecessary #if directive.

* Partial revert
  • Loading branch information
Vakadavr authored and danielwertheim committed Nov 15, 2019
1 parent f770b88 commit fe65dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/projects/EnsureThat/Enforcers/EnumerableArg.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public IEnumerable<T> HasItems<T>([ValidatedNotNull, InstantHandle]IEnumerable<T
{
Ensure.Any.IsNotNull(value, paramName);

if (value.Count() == 0)
if (!value.Any())
throw Ensure.ExceptionFactory.ArgumentException(
ExceptionMessages.Collections_HasItemsFailed,
paramName,
Expand Down

0 comments on commit fe65dd0

Please sign in to comment.