Skip to content

Commit 1406409

Browse files
authored
Merge pull request #31688 from benrimmington/se-0191-numeric-cast-2
[stdlib] Remove more unneeded `numericCast`s
2 parents 7d2f944 + 0061d89 commit 1406409

File tree

108 files changed

+705
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+705
-705
lines changed

stdlib/private/StdlibCollectionUnittest/CheckCollectionInstance.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See https://swift.org/LICENSE.txt for license information
@@ -941,7 +941,7 @@ public func checkOneLevelOfRandomAccessCollection<
941941
instances,
942942
distances: distances,
943943
of: collection,
944-
distanceOracle: { (x:Int, y:Int) in numericCast(y - x) },
944+
distanceOracle: { (x:Int, y:Int) in y - x },
945945
advanceOracle: { x, y in nextN(distances[y], instances[x]) },
946946
startIndex: collection.startIndex,
947947
endIndex: next5(partWay1), message(),
@@ -1709,7 +1709,7 @@ public func checkOneLevelOfRandomAccessCollection<
17091709
instances,
17101710
distances: distances,
17111711
of: collection,
1712-
distanceOracle: { (x:Int, y:Int) in numericCast(y - x) },
1712+
distanceOracle: { (x:Int, y:Int) in y - x },
17131713
advanceOracle: { x, y in nextN(distances[y], instances[x]) },
17141714
startIndex: collection.startIndex,
17151715
endIndex: next5(partWay1), message(),
@@ -1888,7 +1888,7 @@ public func checkRangeReplaceable<C, N>(
18881888
let growth = newCount - oldCount
18891889

18901890
let expectedCount = source.count + growth
1891-
let actualCount = numericCast(a.count) as Int
1891+
let actualCount = a.count
18921892
if actualCount != expectedCount {
18931893
reportFailure(
18941894
&a, "\(actualCount) != expected count \(expectedCount)")

0 commit comments

Comments
 (0)