File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -796,10 +796,11 @@ extension Dictionary {
796
796
797
797
// Prepare storage.
798
798
// If `key` isn't in the dictionary yet, assume that this access will end
799
- // up inserting it. Otherwise this can only be a removal or an in-place
800
- // mutation. (If we guess wrong, we might needlessly rehash; that's fine.)
799
+ // up inserting it. (If we guess wrong, we might needlessly expand
800
+ // storage; that's fine.) Otherwise this can only be a removal or an
801
+ // in-place mutation.
801
802
let ( _, rehashed) = _variant. ensureUniqueNative (
802
- withCapacity: self . capacity + ( found ? 0 : 1 ) ,
803
+ withCapacity: self . count + ( found ? 0 : 1 ) ,
803
804
isUnique: isUnique)
804
805
// FIXME: we should be able to make this a let; however, some of the
805
806
// low-level operations below are (incorrectly) marked as mutating.
You can’t perform that action at this time.
0 commit comments