Skip to content

Commit 3916380

Browse files
authored
Prefix countRepresentedWords with underscore [NFC]
Per comments, `countRepresentedWords` is slated for eventual removal along with `_words(at:)`; it's not a part of SE-0104, so let's show users that it's not intended for public consumption.
1 parent 268e494 commit 3916380

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/public/core/Integers.swift.gyb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,7 +1548,7 @@ extension BinaryInteger {
15481548
///
15491549
/// This property is a constant for instances of fixed-width integer types.
15501550
@_transparent
1551-
public var countRepresentedWords: Int {
1551+
public var _countRepresentedWords: Int {
15521552
return (self.bitWidth + ${word_bits} - 1) / ${word_bits}
15531553
}
15541554

@@ -1896,11 +1896,11 @@ extension BinaryInteger {
18961896
}
18971897

18981898
// FIXME(integers): inefficient. Should get rid of _word(at:) and
1899-
// countRepresentedWords, and make `words` the basic operation.
1899+
// _countRepresentedWords, and make `words` the basic operation.
19001900
public var words: [UInt] {
19011901
var result = [UInt]()
1902-
result.reserveCapacity(countRepresentedWords)
1903-
for i in 0..<self.countRepresentedWords {
1902+
result.reserveCapacity(_countRepresentedWords)
1903+
for i in 0..<self._countRepresentedWords {
19041904
result.append(_word(at: i))
19051905
}
19061906
return result
@@ -2328,7 +2328,7 @@ ${unsafeOperationComment(x.operator)}
23282328
else {
23292329
var result: Self = source < (0 as T) ? ~0 : 0
23302330
// start with the most significant word
2331-
var n = source.countRepresentedWords
2331+
var n = source._countRepresentedWords
23322332
while n >= 0 {
23332333
// masking is OK here because this we have already ensured
23342334
// that Self.bitWidth > ${word_bits}. Not masking results in
@@ -2801,7 +2801,7 @@ ${assignmentOperatorComment(x.operator, True)}
28012801
@_transparent
28022802
public func _word(at n: Int) -> UInt {
28032803
_precondition(n >= 0, "Negative word index")
2804-
if _fastPath(n < countRepresentedWords) {
2804+
if _fastPath(n < _countRepresentedWords) {
28052805
let shift = UInt(n._value) &* ${word_bits}
28062806
let bitWidth = UInt(self.bitWidth._value)
28072807
_sanityCheck(shift < bitWidth)

0 commit comments

Comments
 (0)