in src/Microsoft.VisualStudio.Validation/Requires.cs [185:203]
public static void NotNullOrEmpty([ValidatedNotNull, NotNull] IEnumerable values, string? parameterName)
{
// To whoever is doing random code cleaning:
// Consider the performance when changing the code to delegate to NotNull.
// In general do not chain call to another function, check first and return as earlier as possible.
if (values is null)
{
throw new ArgumentNullException(parameterName);
}
IEnumerator enumerator = values.GetEnumerator();
using (enumerator as IDisposable)
{
if (!enumerator.MoveNext())
{
throw new ArgumentException(Format(Strings.Argument_EmptyArray, parameterName), parameterName);
}
}
}