Skip to content

Commit 9996d07

Browse files
committed
[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.
1 parent 735fe97 commit 9996d07

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
@@ -2770,7 +2770,6 @@ ${assignmentOperatorComment(x.operator, True)}
27702770
)._lowWord._value)
27712771
}
27722772

2773-
% if Self == 'UInt' or (bits > word_bits and not signed):
27742773
// FIXME should be RandomAccessCollection
27752774
public struct Words : BidirectionalCollection {
27762775
public typealias Indices = CountableRange<Int>
@@ -2813,21 +2812,6 @@ ${assignmentOperatorComment(x.operator, True)}
28132812
public var words: Words {
28142813
return Words(self)
28152814
}
2816-
% elif bits > word_bits:
2817-
public typealias Words = ${OtherSelf}.Words
2818-
2819-
@_transparent
2820-
public var words: Words {
2821-
return Words(${OtherSelf}(self._value))
2822-
}
2823-
% else:
2824-
public typealias Words = UInt.Words
2825-
2826-
@_transparent
2827-
public var words: Words {
2828-
return Words(self._lowWord)
2829-
}
2830-
% end
28312815

28322816
@_transparent
28332817
public // transparent

0 commit comments

Comments
 (0)