Gifu/Source/ArrayExtension.swift

6 lines
117 B
Swift
Raw Normal View History

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