Skip to content

Commit 0327fc3

Browse files
committed
Merge pull request #1187 from glessard/increments
silence some warnings in validation-test/stdlib/Algorithm.swift
2 parents 00bde09 + a4a338b commit 0327fc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

validation-test/stdlib/Algorithm.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,20 @@ Algorithm.test("sorted/complexity") {
205205
// Check performance of sort on array of repeating values
206206
var comparisons_100 = 0
207207
ary = [Int](count: 100, repeatedValue: 0)
208-
ary.sortInPlace { comparisons_100++; return $0 < $1 }
208+
ary.sortInPlace { comparisons_100 += 1; return $0 < $1 }
209209
var comparisons_1000 = 0
210210
ary = [Int](count: 1000, repeatedValue: 0)
211-
ary.sortInPlace { comparisons_1000++; return $0 < $1 }
211+
ary.sortInPlace { comparisons_1000 += 1; return $0 < $1 }
212212
expectTrue(comparisons_1000/comparisons_100 < 20)
213213

214214
// Try to construct 'bad' case for quicksort, on which the algorithm
215215
// goes quadratic.
216216
comparisons_100 = 0
217217
ary = makeQSortKiller(100)
218-
ary.sortInPlace { comparisons_100++; return $0 < $1 }
218+
ary.sortInPlace { comparisons_100 += 1; return $0 < $1 }
219219
comparisons_1000 = 0
220220
ary = makeQSortKiller(1000)
221-
ary.sortInPlace { comparisons_1000++; return $0 < $1 }
221+
ary.sortInPlace { comparisons_1000 += 1; return $0 < $1 }
222222
expectTrue(comparisons_1000/comparisons_100 < 20)
223223
}
224224

0 commit comments

Comments
 (0)