internal IEnumerator<T> InternalArray__IEnumerable_GetEnumerator<T> ()
{
- return new InternalEnumerator<T> (this);
+ if (Length == 0)
+ return EmptyInternalEnumerator<T>.Value;
+ else
+ return new InternalEnumerator<T> (this);
}
internal void InternalArray__ICollection_Clear ()
}
}
+ internal class EmptyInternalEnumerator<T> : IEnumerator<T>
+ {
+ public static readonly EmptyInternalEnumerator<T> Value = new EmptyInternalEnumerator<T> ();
+
+ public void Dispose ()
+ {
+ return;
+ }
+
+ public bool MoveNext ()
+ {
+ return false;
+ }
+
+ public T Current {
+ get {
+ throw new InvalidOperationException ("Enumeration has not started. Call MoveNext");
+ }
+ }
+
+ object IEnumerator.Current {
+ get {
+ return Current;
+ }
+ }
+
+ void IEnumerator.Reset ()
+ {
+ return;
+ }
+ }
+
// InternalCall Methods
[MethodImplAttribute (MethodImplOptions.InternalCall)]
extern int GetRank ();