by _flux · 2mo ago · 0 comments
There are cases where contains or get would have to iterate over the whole array, basically when all the previously added elements hash-collide, i.e., are mapped to the same start-index. But every hash-implementation has pathological cases where the access methods get slow -- but if the keys are sufficiently random, you don't expect such cases to occur in practice.
I suppose that would work, but I can't recall ever hearing of an implementation that actually does that.