File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ extension ReversedCollection {
257
257
/// - Complexity: O(1)
258
258
@inlinable
259
259
@available ( swift, introduced: 4.2 )
260
- public func reversed( ) -> Base {
260
+ public __consuming func reversed( ) -> Base {
261
261
return _base
262
262
}
263
263
}
@@ -289,7 +289,7 @@ extension BidirectionalCollection {
289
289
///
290
290
/// - Complexity: O(1)
291
291
@inlinable
292
- public func reversed( ) -> ReversedCollection < Self > {
292
+ public __consuming func reversed( ) -> ReversedCollection < Self > {
293
293
return ReversedCollection ( _base: self )
294
294
}
295
295
}
@@ -303,7 +303,7 @@ extension LazyCollectionProtocol
303
303
///
304
304
/// - Complexity: O(1)
305
305
@inlinable
306
- public func reversed( ) -> LazyCollection < ReversedCollection < Elements > > {
306
+ public __consuming func reversed( ) -> LazyCollection < ReversedCollection < Elements > > {
307
307
return ReversedCollection ( _base: elements) . lazy
308
308
}
309
309
}
Original file line number Diff line number Diff line change @@ -750,7 +750,7 @@ extension Sequence {
750
750
///
751
751
/// - Complexity: O(*n*), where *n* is the length of the sequence.
752
752
@inlinable
753
- public func reversed( ) -> [ Element ] {
753
+ public __consuming func reversed( ) -> [ Element ] {
754
754
// FIXME(performance): optimize to 1 pass? But Array(self) can be
755
755
// optimized to a memcpy() sometimes. Those cases are usually collections,
756
756
// though.
You can’t perform that action at this time.
0 commit comments