1
- //===--- IndexPathTest.swift -------------------------------------------===//
1
+ //===--- IndexPathTest.swift ---------------------------------------------- ===//
2
2
//
3
3
// This source file is part of the Swift.org open source project
4
4
//
@@ -46,15 +46,13 @@ public let IndexPathTest = [
46
46
]
47
47
48
48
@inline ( __always)
49
- func indexPath( _ size: Int ,
50
- reversed: Bool = false ) -> IndexPath {
49
+ func indexPath( _ size: Int , reversed: Bool = false ) -> IndexPath {
51
50
let indexes = Array ( 0 ..< size)
52
51
return IndexPath ( indexes: reversed ? indexes. reversed ( ) : indexes)
53
52
}
54
53
55
54
@inline ( __always)
56
- func indexPath( _ size: Int ,
57
- middle: Int ) -> IndexPath {
55
+ func indexPath( _ size: Int , middle: Int ) -> IndexPath {
58
56
var indexes = Array ( 0 ..< size)
59
57
indexes. insert ( middle, at: ( indexes. count - 1 ) / 2 )
60
58
return IndexPath ( indexes: indexes)
@@ -79,18 +77,14 @@ func subscriptMutation(n: Int,
79
77
80
78
@inline ( never)
81
79
public func run_IndexPathSubscriptMutation( _ n: Int , _ count: Int ) {
82
- subscriptMutation ( n: n,
83
- mutations: count,
84
- mutate: { ip, i in
80
+ subscriptMutation ( n: n, mutations: count, mutate: { ip, i in
85
81
ip [ i % 4 ] += 1
86
82
} )
87
83
}
88
84
89
85
@inline ( never)
90
86
public func run_IndexPathSubscriptRangeMutation( _ n: Int , _ count: Int ) {
91
- subscriptMutation ( n: count,
92
- mutations: count,
93
- mutate: { ip, i in
87
+ subscriptMutation ( n: count, mutations: count, mutate: { ip, i in
94
88
ip [ 0 ..< i] += [ i]
95
89
} )
96
90
}
0 commit comments