Skip to content

Update benchmark code for SE-0081 moved where clause - NFC #3784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/single-source/DictTest2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public func run_Dictionary2(_ N: Int) {
CheckResults(res == ref_result, "Incorrect results in Dictionary2: \(res) != \(ref_result)")
}

class Box<T : Hashable> : Hashable {
class Box<T : Hashable> : Hashable where T : Equatable {
var value: T

init(_ v: T) {
Expand Down
3 changes: 2 additions & 1 deletion benchmark/single-source/Histogram.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import TestsUtils

typealias rrggbb_t = UInt32

func output_sorted_sparse_rgb_histogram<S: Sequence where S.Iterator.Element == rrggbb_t>(_ samples: S, _ N: Int) {
func output_sorted_sparse_rgb_histogram<S: Sequence>(_ samples: S, _ N: Int)
where S.Iterator.Element == rrggbb_t {
var histogram = Dictionary<rrggbb_t, Int>()
for _ in 1...50*N {
for sample in samples { // This part is really awful, I agree
Expand Down
10 changes: 5 additions & 5 deletions benchmark/single-source/PopFrontGeneric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ extension Array : MyArrayBufferProtocol {
}
}

func myArrayReplace<B: MyArrayBufferProtocol, C: Collection
where C.Iterator.Element == B.Element, B.Index == Int
>(
_ target: inout B, _ subRange: Range<Int>, _ newValues: C
) {
func myArrayReplace<
B: MyArrayBufferProtocol,
C: Collection
>(_ target: inout B, _ subRange: Range<Int>, _ newValues: C)
where C.Iterator.Element == B.Element, B.Index == Int {
target.myReplace(subRange, with: newValues)
}

Expand Down