1

Closed

TryFind doesn't dispose enumerator

description

In TryFindHelper, a new IEnumerator created but it is not disposed.
        var results = source.Where(predicate).GetEnumerator();

        if (results.MoveNext())
        {
            return Option.Some(results.Current);
        }
        else
        {
            return Option<TSource>.None;
        }
Maybe a using should help to eliminate this problem.
Closed Sep 18, 2009 at 7:05 PM by
Thanks for the catch. Good eyes!

Fixed in change set 43592.

comments