Skip to content

Commit ea07472

Browse files
committed
stdlib: Dictionary: rename the wordsFor() function to conform to API guidelines
1 parent f786137 commit ea07472

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,7 +2472,7 @@ internal struct _BitMap {
24722472
return UInt(bitPattern: i) % UInt(UInt._sizeInBits)
24732473
}
24742474

2475-
internal static func wordsFor(_ bitCount: Int) -> Int {
2475+
internal static func sizeInWords(forCapacity bitCount: Int) -> Int {
24762476
return bitCount + Int._sizeInBytes - 1 / Int._sizeInBytes
24772477
}
24782478

@@ -2482,7 +2482,7 @@ internal struct _BitMap {
24822482
}
24832483

24842484
internal var numberOfWords: Int {
2485-
return _BitMap.wordsFor(bitCount)
2485+
return _BitMap.sizeInWords(forCapacity: bitCount)
24862486
}
24872487

24882488
internal func initializeToZero() {
@@ -2544,7 +2544,7 @@ final internal class _Native${Self}StorageImpl<${TypeParameters}> :
25442544
/// Returns the bytes necessary to store a bit map of 'capacity' bytes and
25452545
/// padding to align the start to word alignment.
25462546
internal static func bytesForBitMap(capacity: Int) -> Int {
2547-
let numWords = _BitMap.wordsFor(capacity)
2547+
let numWords = _BitMap.sizeInWords(forCapacity: capacity)
25482548
return numWords * strideof(UInt) + alignof(UInt)
25492549
}
25502550

@@ -2608,7 +2608,7 @@ final internal class _Native${Self}StorageImpl<${TypeParameters}> :
26082608

26092609
internal var _keys: UnsafeMutablePointer<Key> {
26102610
let bitMapSizeInBytes =
2611-
_unsafeMultiply(_BitMap.wordsFor(_capacity), strideof(UInt))
2611+
_unsafeMultiply(_BitMap.sizeInWords(forCapacity: _capacity), strideof(UInt))
26122612
let start =
26132613
UnsafeMutablePointer<UInt8>(_initializedHashtableEntriesBitMapStorage)
26142614
+ bitMapSizeInBytes

0 commit comments

Comments
 (0)