Gifu/Source/ArrayExtension.swift
2015-10-22 20:49:31 +02:00

6 lines
117 B
Swift

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