score:17

Accepted answer

from the reference source, yes it does, though not directly:

public static bool contains<tsource>(this ienumerable<tsource> source, tsource value) {
    icollection<tsource> collection = source as icollection<tsource>;
    if (collection != null) return collection.contains(value);
    return contains<tsource>(source, value, null);
}

if the source enumerable implements icollection<t> (and hashset<t> does), then it uses the collection's contains method.

score:1

note also it is documented to look for icollection<t> (see remarks).


Related Query

More Query from same tag