Skip to content

Commit bc86ff8

Browse files
committed
Address comments
1 parent f7a831b commit bc86ff8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Sources/SwiftExtensions/Array+Safe.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ extension Array {
1414
/// Returns the element at the specified index if it is within the Array's
1515
/// bounds, otherwise `nil`.
1616
public subscript(safe index: Index) -> Element? {
17-
return index > 0 && index < count ? self[index] : nil
17+
return index >= 0 && index < count ? self[index] : nil
1818
}
1919
}

Sources/SwiftExtensions/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
add_library(SwiftExtensions STATIC
3+
Array+Safe.swift
34
AsyncQueue.swift
45
AsyncUtils.swift
56
Collection+Only.swift

0 commit comments

Comments
 (0)