Commit Graph

8 Commits

Author SHA1 Message Date
Nate Cook
58933d88c5 [stdlib] Rename index(...) methods to firstIndex(...)
A la SE-204.
2018-04-21 18:07:25 -05:00
Karoy Lorentey
ccdc218cbd [stdlib] _Hasher: append => combine 2018-04-18 14:18:44 +01:00
Karoy Lorentey
cff4eb77ef [stdlib] {Set,Dictionary}.init(minimumCapacity:) Update docs
Avoid describing the exact algorithm that these collections use to allocate storage. (It is a private implementation detail that we want to be able to change.)

rdar://problem/36619317
2018-04-11 12:25:51 +01:00
Slava Pestov
2e5aef9c8d stdlib: Remove redundant @usableFromInline attributes 2018-04-06 00:02:30 -07:00
Slava Pestov
e1f50b2d36 SE-0193: Rename @_inlineable to @inlinable, @_versioned to @usableFromInline 2018-03-30 21:55:30 -07:00
Karoy Lorentey
96d93a4f94 [stdlib] Set, Dictionary: Clarify assert message when a duplicate key is found
When a duplicate key is found during rehashing, it is usually either because a key was mutated after insertion, or because the dictionary itself was mutated from multiple threads at the same time.

Both of these are serious programmer errors. Promote the sanity check for duplicate keys to a full precondition and improve the error message to point out the most probable cause of the failure.
2018-03-28 11:59:13 +01:00
Karoy Lorentey
b961736318 [stdlib] Set, Dictionary: cosmetic changes (NFC)
Reindent, refresh coding conventions, move some members around.
(This would be disruptive at any other time, but we're right after a degybbing, so...)
2018-03-21 18:33:46 +00:00
Karoy Lorentey
3d0b6e7b2d [stdlib] De-gyb and split HashedCollections.swift.gyb (NFC)
Split HashedCollections.swift.gyb into separate Set.swift and Dictionary.swift files, with some common parts going into Hashing.swift.

This is mostly a mechanical change, in preparation of unification of common parts between Set & Dictionary.

rdar://problem/34038727
2018-03-21 18:33:09 +00:00