File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -796,10 +796,11 @@ extension Dictionary {
796796
797797 // Prepare storage.
798798 // 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.
801802 let ( _, rehashed) = _variant. ensureUniqueNative (
802- withCapacity: self . capacity + ( found ? 0 : 1 ) ,
803+ withCapacity: self . count + ( found ? 0 : 1 ) ,
803804 isUnique: isUnique)
804805 // FIXME: we should be able to make this a let; however, some of the
805806 // low-level operations below are (incorrectly) marked as mutating.
You can’t perform that action at this time.
0 commit comments