Skip to content

Commit ab8e3a7

Browse files
Fix warnings in various benchmarks (swiftlang#14333)
1 parent 072aedc commit ab8e3a7

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

benchmark/single-source/Combos.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public func run_Combos(_ N: Int) {
1818
var combos = [[Character]]()
1919

2020
for _ in 1...10*N {
21-
combos = combinations("ABCDEFGHIJ".characters, "0123456789".characters).map {
21+
combos = combinations("ABCDEFGHIJ", "0123456789").map {
2222
return [$0] + [$1]
2323
}
2424

benchmark/single-source/LuhnAlgoEager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ let combineDoubleDigits = {
220220
// removing lazy at start of pipeline
221221
// switches to array-based version
222222
let eagerchecksum = { (ccnum: String) -> Bool in
223-
ccnum.characters//.lazy
223+
ccnum //.lazy
224224
|> { $0.reversed().lazy }
225225
|> { mapSome($0, charToInt) }
226226
|> { mapEveryN($0, 2, double) }

benchmark/single-source/LuhnAlgoLazy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ let combineDoubleDigits = {
219219

220220
// first, the lazy version of checksum calcuation
221221
let lazychecksum = { (ccnum: String) -> Bool in
222-
ccnum.characters.lazy
222+
ccnum.lazy
223223
|> reverse
224224
|> { mapSome($0, charToInt) }
225225
|> { mapEveryN($0, 2, double) }

benchmark/single-source/NibbleSort.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ struct NibbleCollection: RandomAccessCollection, MutableCollection {
3838
let startIndex: UInt64 = 0
3939
let endIndex: UInt64 = 16
4040

41-
subscript(bounds: Range<Index>)
42-
-> MutableRandomAccessSlice<NibbleCollection> {
41+
subscript(bounds: Range<Index>) -> Slice<NibbleCollection> {
4342
get {
4443
fatalError("Should not be called. Added here to please the type checker")
4544
}

benchmark/single-source/StringRemoveDupes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public func run_StringRemoveDupes(_ N: Int) {
2424
for _ in 1...10*N {
2525
s = text.removeDuplicates()
2626

27-
if s.characters.count != textLengthRef {
27+
if s.count != textLengthRef {
2828
break
2929
}
3030
}
3131

32-
CheckResults(s.characters.count == textLengthRef)
32+
CheckResults(s.count == textLengthRef)
3333
}
3434

3535
// removes all but first occurrence from a sequence, returning an array.
@@ -46,6 +46,6 @@ func uniq<S: Sequence,
4646
// all duplicates removed
4747
extension String {
4848
func removeDuplicates() -> String {
49-
return String(uniq(self.characters))
49+
return String(uniq(self))
5050
}
5151
}

stdlib/private/StdlibCollectionUnittest/CheckRangeReplaceableSliceType.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ extension TestSuite {
241241
_ = c.removeLast() // Should trap.
242242
}
243243

244-
//===----------------------------------------------------------------------===//
244+
//===------------------------------------------------------------------===//
245245
// removeLast(n: Int)
246-
//===----------------------------------------------------------------------===//
246+
//===------------------------------------------------------------------===//
247247

248248
self.test("\(testNamePrefix).removeLast(n: Int)/semantics") {
249249
for test in removeLastTests {

0 commit comments

Comments
 (0)