Skip to content

Commit 60160cf

Browse files
Dave AbrahamsDave Abrahams
authored andcommitted
[stdlib] New integers simplify generic code!
1 parent d4030a9 commit 60160cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Prototypes/CollectionTransformers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ internal func _splitRandomAccessIndexRange<
5757
) -> [Range<C.Index>] {
5858
let startIndex = range.lowerBound
5959
let endIndex = range.upperBound
60-
let length = elements.distance(from: startIndex, to: endIndex).toIntMax()
60+
let length = elements.distance(from: startIndex, to: endIndex)
6161
if length < 2 {
6262
return [range]
6363
}
64-
let middle = elements.index(startIndex, offsetBy: C.IndexDistance(length / 2))
64+
let middle = elements.index(startIndex, offsetBy: length / 2)
6565
return [startIndex ..< middle, middle ..< endIndex]
6666
}
6767

0 commit comments

Comments
 (0)