Skip to content

Commit 7be7cc5

Browse files
authored
Merge pull request #3784 from bitjammer/update-benchmarks-where-clause
Update benchmark code for SE-0081 moved where clause - NFC
2 parents 2c85b5d + c2f1298 commit 7be7cc5

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

benchmark/single-source/DictTest2.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public func run_Dictionary2(_ N: Int) {
3737
CheckResults(res == ref_result, "Incorrect results in Dictionary2: \(res) != \(ref_result)")
3838
}
3939

40-
class Box<T : Hashable> : Hashable {
40+
class Box<T : Hashable> : Hashable where T : Equatable {
4141
var value: T
4242

4343
init(_ v: T) {

benchmark/single-source/Histogram.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import TestsUtils
1616

1717
typealias rrggbb_t = UInt32
1818

19-
func output_sorted_sparse_rgb_histogram<S: Sequence where S.Iterator.Element == rrggbb_t>(_ samples: S, _ N: Int) {
19+
func output_sorted_sparse_rgb_histogram<S: Sequence>(_ samples: S, _ N: Int)
20+
where S.Iterator.Element == rrggbb_t {
2021
var histogram = Dictionary<rrggbb_t, Int>()
2122
for _ in 1...50*N {
2223
for sample in samples { // This part is really awful, I agree

benchmark/single-source/PopFrontGeneric.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ extension Array : MyArrayBufferProtocol {
3535
}
3636
}
3737

38-
func myArrayReplace<B: MyArrayBufferProtocol, C: Collection
39-
where C.Iterator.Element == B.Element, B.Index == Int
40-
>(
41-
_ target: inout B, _ subRange: Range<Int>, _ newValues: C
42-
) {
38+
func myArrayReplace<
39+
B: MyArrayBufferProtocol,
40+
C: Collection
41+
>(_ target: inout B, _ subRange: Range<Int>, _ newValues: C)
42+
where C.Iterator.Element == B.Element, B.Index == Int {
4343
target.myReplace(subRange, with: newValues)
4444
}
4545

0 commit comments

Comments
 (0)