Skip to content

Commit 64de151

Browse files
lorenteyMax Moiseev
authored andcommitted
[stdlib] Define custom Words types for each standard fixed with integer
This adds 8 more collection views, but makes integer definitions more consistent across all the available bit widths and between 32-bit and 64-bit platforms. (cherry picked from commit 9996d07)
1 parent e467a70 commit 64de151

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

stdlib/public/core/Integers.swift.gyb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2738,7 +2738,6 @@ ${assignmentOperatorComment(x.operator, True)}
27382738
)._lowWord._value)
27392739
}
27402740

2741-
% if Self == 'UInt' or (bits > word_bits and not signed):
27422741
// FIXME should be RandomAccessCollection
27432742
public struct Words : BidirectionalCollection {
27442743
public typealias Indices = CountableRange<Int>
@@ -2781,21 +2780,6 @@ ${assignmentOperatorComment(x.operator, True)}
27812780
public var words: Words {
27822781
return Words(self)
27832782
}
2784-
% elif bits > word_bits:
2785-
public typealias Words = ${OtherSelf}.Words
2786-
2787-
@_transparent
2788-
public var words: Words {
2789-
return Words(${OtherSelf}(self._value))
2790-
}
2791-
% else:
2792-
public typealias Words = UInt.Words
2793-
2794-
@_transparent
2795-
public var words: Words {
2796-
return Words(self._lowWord)
2797-
}
2798-
% end
27992783

28002784
@_transparent
28012785
public // transparent

0 commit comments

Comments
 (0)