@@ -189,7 +189,7 @@ public struct ExclusiveReductions<Result, Base: Sequence> {
189
189
@usableFromInline
190
190
internal let transform : ( inout Result , Base . Element ) -> Void
191
191
192
- @usableFromInline
192
+ @inlinable
193
193
internal init (
194
194
base: Base ,
195
195
initial: Result ,
@@ -212,7 +212,7 @@ extension ExclusiveReductions: Sequence {
212
212
@usableFromInline
213
213
internal let transform : ( inout Result , Base . Element ) -> Void
214
214
215
- @usableFromInline
215
+ @inlinable
216
216
internal init (
217
217
iterator: Base . Iterator ,
218
218
current: Result ? = nil ,
@@ -249,27 +249,23 @@ extension ExclusiveReductions: Collection where Base: Collection {
249
249
internal let representation : ReductionsIndexRepresentation < Base . Index , Result >
250
250
251
251
@inlinable
252
- public static func < ( lhs: Self , rhs: Self ) -> Bool {
253
- lhs. representation < rhs. representation
252
+ internal init (
253
+ _ representation: ReductionsIndexRepresentation < Base . Index , Result >
254
+ ) {
255
+ self . representation = representation
254
256
}
255
257
256
- @usableFromInline
257
- internal static func base ( index : Base . Index , result : Result ) -> Self {
258
- Self ( representation: . base ( index : index , result : result ) )
258
+ @inlinable
259
+ public static func < ( lhs : Self , rhs : Self ) -> Bool {
260
+ lhs . representation < rhs . representation
259
261
}
260
-
261
- @usableFromInline
262
- internal static var start : Self { Self ( representation: . start) }
263
-
264
- @usableFromInline
265
- internal static var end : Self { Self ( representation: . end) }
266
262
}
267
263
268
264
@inlinable
269
- public var startIndex : Index { . start }
265
+ public var startIndex : Index { Index ( . start) }
270
266
271
267
@inlinable
272
- public var endIndex : Index { . end }
268
+ public var endIndex : Index { Index ( . end) }
273
269
274
270
@inlinable
275
271
public subscript( position: Index ) -> Result {
@@ -286,7 +282,7 @@ extension ExclusiveReductions: Collection where Base: Collection {
286
282
guard index != base. endIndex else { return endIndex }
287
283
var previous = previous
288
284
transform ( & previous, base [ index] )
289
- return . base( index: index, result: previous)
285
+ return Index ( . base( index: index, result: previous) )
290
286
}
291
287
switch i. representation {
292
288
case . start:
@@ -414,7 +410,7 @@ public struct InclusiveReductions<Base: Sequence> {
414
410
@usableFromInline
415
411
internal let transform : ( Base . Element , Base . Element ) -> Base . Element
416
412
417
- @usableFromInline
413
+ @inlinable
418
414
internal init (
419
415
base: Base ,
420
416
transform: @escaping ( Base . Element , Base . Element ) -> Base . Element
@@ -435,7 +431,7 @@ extension InclusiveReductions: Sequence {
435
431
@usableFromInline
436
432
internal let transform : ( Base . Element , Base . Element ) -> Base . Element
437
433
438
- @usableFromInline
434
+ @inlinable
439
435
internal init (
440
436
iterator: Base . Iterator ,
441
437
element: Base . Element ? = nil ,
@@ -471,30 +467,26 @@ extension InclusiveReductions: Collection where Base: Collection {
471
467
internal let representation : ReductionsIndexRepresentation < Base . Index , Base . Element >
472
468
473
469
@inlinable
474
- public static func < ( lhs: Self , rhs: Self ) -> Bool {
475
- lhs. representation < rhs. representation
470
+ internal init (
471
+ _ representation: ReductionsIndexRepresentation < Base . Index , Base . Element >
472
+ ) {
473
+ self . representation = representation
476
474
}
477
475
478
- @usableFromInline
479
- internal static func base ( index : Base . Index , result : Base . Element ) -> Self {
480
- Self ( representation: . base ( index : index , result : result ) )
476
+ @inlinable
477
+ public static func < ( lhs : Self , rhs : Self ) -> Bool {
478
+ lhs . representation < rhs . representation
481
479
}
482
-
483
- @usableFromInline
484
- internal static var start : Self { Self ( representation: . start) }
485
-
486
- @usableFromInline
487
- internal static var end : Self { Self ( representation: . end) }
488
480
}
489
481
490
482
@inlinable
491
483
public var startIndex : Index {
492
484
guard base. startIndex != base. endIndex else { return endIndex }
493
- return . start
485
+ return Index ( . start)
494
486
}
495
487
496
488
@inlinable
497
- public var endIndex : Index { . end }
489
+ public var endIndex : Index { Index ( . end) }
498
490
499
491
@inlinable
500
492
public subscript( position: Index ) -> Base . Element {
@@ -510,7 +502,7 @@ extension InclusiveReductions: Collection where Base: Collection {
510
502
func index( after i: Base . Index , previous: Base . Element ) -> Index {
511
503
let index = base. index ( after: i)
512
504
guard index != base. endIndex else { return endIndex }
513
- return . base( index: index, result: transform ( previous, base [ index] ) )
505
+ return Index ( . base( index: index, result: transform ( previous, base [ index] ) ) )
514
506
}
515
507
switch i. representation {
516
508
case . start:
@@ -563,7 +555,7 @@ enum ReductionsIndexRepresentation<BaseIndex: Comparable, Result> {
563
555
}
564
556
565
557
extension ReductionsIndexRepresentation : Equatable {
566
- @usableFromInline
558
+ @inlinable
567
559
static func == ( lhs: Self , rhs: Self ) -> Bool {
568
560
switch ( lhs, rhs) {
569
561
case ( . start, . start) : return true
@@ -575,7 +567,7 @@ extension ReductionsIndexRepresentation: Equatable {
575
567
}
576
568
577
569
extension ReductionsIndexRepresentation : Comparable {
578
- @usableFromInline
570
+ @inlinable
579
571
static func < ( lhs: Self , rhs: Self ) -> Bool {
580
572
switch ( lhs, rhs) {
581
573
case ( _, . start) : return false
0 commit comments