Skip to content

Commit 6cb9e5c

Browse files
committed
Build fixes
1 parent 78e406c commit 6cb9e5c

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

benchmark/single-source/NaiveRangeReplaceableCollectionConformance.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
import TestsUtils
1414

15-
var contiguous:[UInt8]?
15+
var contiguous:[UInt8] = []
1616

1717
public let benchmarks = [
18-
BenchmarkInfo(name: "NaiveRRC.append.largeContiguous",
19-
runFunction: runAppendLargeContiguous,
20-
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000_000) },
21-
tags: [.validation, .api]),
22-
BenchmarkInfo(name: "NaiveRRC.append.smallContiguousRepeatedly",
23-
runFunction: runAppendLargeContiguous,
24-
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1) },
25-
tags: [.validation, .api]),
26-
BenchmarkInfo(name: "NaiveRRC.init.largeContiguous",
27-
runFunction: runInitContiguous,
28-
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000_000) },
29-
tags: [.validation, .api]),
18+
BenchmarkInfo(name: "NaiveRRC.append.largeContiguous",
19+
runFunction: runAppendLargeContiguous,
20+
tags: [.validation, .api],
21+
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000_000) }),
22+
BenchmarkInfo(name: "NaiveRRC.append.smallContiguousRepeatedly",
23+
runFunction: runAppendLargeContiguous,
24+
tags: [.validation, .api],
25+
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1) }),
26+
BenchmarkInfo(name: "NaiveRRC.init.largeContiguous",
27+
runFunction: runInitLargeContiguous,
28+
tags: [.validation, .api],
29+
setUpFunction: { contiguous = [UInt8](repeating: 7, count: 1_000_000) })
3030
]
3131

3232
struct NaiveRRC : RangeReplaceableCollection {
@@ -78,7 +78,7 @@ public func runAppendLargeContiguous(N: Int) {
7878
for _ in 1...N {
7979
var rrc = NaiveRRC()
8080
rrc.append(contentsOf: contiguous)
81-
blackHole(rrc.count + rrc.last)
81+
blackHole(rrc.count + rrc[0])
8282
}
8383
}
8484

@@ -89,14 +89,14 @@ public func runAppendSmallContiguousRepeatedly(N: Int) {
8989
for _ in 1...1_000_000 {
9090
rrc.append(contentsOf: contiguous)
9191
}
92-
blackHole(rrc.count + rrc.last)
92+
blackHole(rrc.count + rrc[0])
9393
}
9494
}
9595

9696
@inline(never)
9797
public func runInitLargeContiguous(N: Int) {
9898
for _ in 1...N {
9999
var rrc = NaiveRRC(contiguous)
100-
blackHole(rrc.count + rrc.last)
100+
blackHole(rrc.count + rrc[0])
101101
}
102102
}

0 commit comments

Comments
 (0)