[swift-dev] Dictionary Collision Resolution Guarantees

Dave Abrahams dabrahams at apple.com
Thu Oct 13 19:46:23 CDT 2016


on Thu Oct 13 2016, Alexis <abeingessner-AT-apple.com> wrote:

>>> This is effectively assuming that the open-addressing scheme being
>>> used is first-come-first-serve (FCFS). That is, any element being
>>> inserted can *only* be inserted into vacant buckets, rather than
>>> displacing existing elements. This is currently only internal docs,
>>> but do we actually want to guarantee this? 
>> 
>> No, not to users.  But "//" comments are not user-level comments and
>> don't imply any guarantees.
>
> OK cool, is there any reason it’s even written down? I don’t see any code
> that’s obviously relying on it. (seems fine to delete it?)

It's written down because we've never formalized our index invalidation
rules.  I didn't realize that this comment was related to index
invalidation.  The guarantee mentioned is one we might want to give, at
least under some circumstances.  We'll have to think about that more
carefully.  In any case, it's not time to delete it yet.

-- 
-Dave


More information about the swift-dev mailing list