We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7a831b commit bc86ff8Copy full SHA for bc86ff8
Sources/SwiftExtensions/Array+Safe.swift
@@ -14,6 +14,6 @@ extension Array {
14
/// Returns the element at the specified index if it is within the Array's
15
/// bounds, otherwise `nil`.
16
public subscript(safe index: Index) -> Element? {
17
- return index > 0 && index < count ? self[index] : nil
+ return index >= 0 && index < count ? self[index] : nil
18
}
19
Sources/SwiftExtensions/CMakeLists.txt
@@ -1,5 +1,6 @@
1
2
add_library(SwiftExtensions STATIC
3
+ Array+Safe.swift
4
AsyncQueue.swift
5
AsyncUtils.swift
6
Collection+Only.swift
0 commit comments