Replace the single-iteration foreach loops
scottdorman opened this issue · 0 comments
scottdorman commented
The single-iteration foreach loops in Requires.NotNullOrEmpty(IEnumerable values, string? parameterName)
and Requires.NotNullOrEmpty<T>(IEnumerable<T> values, string? parameterName)
can be replaced by a direct call to GetEnumerator().MoveNext()
. This results in a slight performance boost and fewer IL instructions generated.