File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -333,20 +333,23 @@ extension ${Self} : Hashable {
333
333
/// different invocations of the same program. Do not persist the
334
334
/// hash value across program runs.
335
335
public var hashValue: Int {
336
+ @inline ( __always)
337
+ get {
336
338
% if bits <= word_bits and signed:
337
- // Sign extend the value.
338
- return Int ( self )
339
+ // Sign extend the value.
340
+ return Int ( self )
339
341
% elif bits <= word_bits and not signed:
340
- // Sign extend the value.
341
- return Int ( ${ OtherSelf} ( bitPattern: self ) )
342
+ // Sign extend the value.
343
+ return Int ( ${ OtherSelf} ( bitPattern: self ) )
342
344
% elif bits == word_bits * 2 :
343
- // We have twice as many bits as we need to return.
344
- return
345
- Int ( truncatingBitPattern: self ) ^
346
- Int ( truncatingBitPattern: self >> 32 )
345
+ // We have twice as many bits as we need to return.
346
+ return
347
+ Int ( truncatingBitPattern: self ) ^
348
+ Int ( truncatingBitPattern: self >> 32 )
347
349
% else :
348
- _Unimplemented ( )
350
+ _Unimplemented ( )
349
351
% end
352
+ }
350
353
}
351
354
}
352
355
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ public struct RangeIterator<
16
16
> : IteratorProtocol , Sequence {
17
17
18
18
/// Construct an instance that traverses the elements of `bounds`.
19
+ @_versioned
19
20
@_transparent
20
21
internal init ( _bounds: Range < Element > ) {
21
22
self . startIndex = _bounds. startIndex
@@ -24,6 +25,7 @@ public struct RangeIterator<
24
25
25
26
/// Advance to the next element and return it, or `nil` if no next
26
27
/// element exists.
28
+ @inline ( __always)
27
29
public mutating func next( ) -> Element ? {
28
30
if startIndex == endIndex { return nil }
29
31
let element = startIndex
@@ -115,6 +117,7 @@ public struct Range<
115
117
/// Returns an iterator over the elements of this sequence.
116
118
///
117
119
/// - Complexity: O(1).
120
+ @inline ( __always)
118
121
public func makeIterator( ) -> RangeIterator < Element > {
119
122
return RangeIterator ( _bounds: self )
120
123
}
You can’t perform that action at this time.
0 commit comments