[swift-dev] Should we remove _customContainsEquatableElement from stdlib?

Ling Wang an00na at gmail.com
Wed Dec 30 12:34:48 CST 2015


After reviewing the code of stdlib I found no one actually implements _customContainsEquatableElement:
1. Its default implementation in `SequenceType` just returns nil.
2. The implementation in `Set` delegates to `contains` which is bad because it reverses their relationship: the default implementation of `contains` in `SequenceType` delegates to `_customContainsEquatableElement`.
3. In all other place it just delegates to another `SequenceType`.

So no one is doing real work.

If the current _customContainsEquatableElement is only a relic I suggest we remove it and clean up related code.


More information about the swift-dev mailing list