Sometimes a HashSet is exposed through a property as an IEnumerable.
It is well known that for enumerable.Count()
the code checks if it is a collection, so it doesn't enumerate the whole list, but takes a shortcut.
Is there any similar check for using the Linq version of enumerable.Contains(x)
and HashSets?