File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -571,8 +571,13 @@ extension _NativeDictionary { // High-level operations
571
571
internal func mapValues< T> (
572
572
_ transform: ( Value ) throws -> T
573
573
) rethrows -> _NativeDictionary < Key , T > {
574
- let result = _NativeDictionary < Key , T > ( capacity: capacity)
575
- // Because the keys in the current and new buffer are the same, we can
574
+ let ( resultStorage, rehash) = _DictionaryStorage < Key , T > . reallocate (
575
+ original: _storage,
576
+ capacity: capacity)
577
+ _sanityCheck ( !rehash)
578
+ _sanityCheck ( resultStorage. _seed == _storage. _seed)
579
+ let result = _NativeDictionary < Key , T > ( resultStorage)
580
+ // Because the current and new buffer have the same scale and seed, we can
576
581
// initialize to the same locations in the new buffer, skipping hash value
577
582
// recalculations.
578
583
for bucket in hashTable {
You can’t perform that action at this time.
0 commit comments