Skip to content

Commit 309f46e

Browse files
committed
condense index to one line
1 parent 68a2a2c commit 309f46e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

stdlib/public/core/Collection.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,10 +930,7 @@ extension Collection {
930930
) -> Element? {
931931
guard !isEmpty else { return nil }
932932
let random = Int.random(in: 0 ..< count, using: &generator)
933-
let idx = index(
934-
startIndex,
935-
offsetBy: random
936-
)
933+
let idx = index(startIndex, offsetBy: random)
937934
return self[idx]
938935
}
939936

0 commit comments

Comments
 (0)