[Mono-devel-list] optimizing foreach on strings (fwd)
vargaz at freemail.hu
Sun Mar 30 11:37:21 EST 2003
Miguel de Icaza <miguel at ximian.com> írta:
> * There are three tests for this case on the same
> routine that returns, and am confused as to why they are
> needed? I thought only the first one was required.
The first test skips the GetEnumerator required by
second test is needed since we want to use the MoveNext and
GetCurrent methods from CharEnumerator and not the ones from
IEnumerator. The third test is a fix: if the enumerator
implement IDisposable, the actual type returned by GetEnumerator
might do, so the try-finally can only be optimized away if
type is sealed.
> * Could you also improve the regression tests accordingly?
More information about the Mono-devel-list