Gifu/Source/Extensions/Array.swift

6 lines
117 B
Swift
Raw Normal View History

extension Array {
subscript(safe index: Int) -> Element? {
return indices ~= index ? self[index] : .none
}
}