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.
The single-iteration foreach loops in
Requires.NotNullOrEmpty(IEnumerable values, string? parameterName)andRequires.NotNullOrEmpty<T>(IEnumerable<T> values, string? parameterName)can be replaced by a direct call toGetEnumerator().MoveNext(). This results in a slight performance boost and fewer IL instructions generated.