Skip to content

Commit 0da6efd

Browse files
committed
stdlib: Dictionary: use strideof() to calculate the array size
Since sizeof(UInt) == strideof(UInt) there is no bug here, but strideof() is the correct API to use for this purpose.
1 parent e424982 commit 0da6efd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2549,7 +2549,7 @@ final internal class _Native${Self}StorageImpl<${TypeParameters}> :
25492549
/// padding to align the start to word alignment.
25502550
internal static func bytesForBitMap(capacity: Int) -> Int {
25512551
let numWords = _BitMap.wordsFor(capacity)
2552-
return numWords * sizeof(UInt) + alignof(UInt)
2552+
return numWords * strideof(UInt) + alignof(UInt)
25532553
}
25542554

25552555
/// Returns the bytes necessary to store 'capacity' keys and padding to align

0 commit comments

Comments
 (0)