Does `Dictionary.Keys.contains(_:)` have `O(1)` time complexity?

The docs for hash(into:) itself are at least a bit more direct and avoid the "essential" terminology:

The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

I've also complained in the past about the lack of clarity in the documentation around Hashable, so I agree it would be great to beef it up with better explanation about the semantic requirements (and perhaps a brief elaboration on why the requirements are the way they are, as discussed in this thread and others on the forums).

Also just want to say that this has been a great thread, have really enjoyed reading everyone's contributions.

6 Likes