mirror of
https://github.com/lux-tel/session-ios.git
synced 2026-10-30 20:38:32 +00:00
14 lines
329 B
Swift
14 lines
329 B
Swift
//
|
|
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public extension Collection {
|
|
|
|
/// Returns the element at the specified index iff it is within bounds, otherwise nil.
|
|
subscript (safe index: Index) -> Element? {
|
|
return indices.contains(index) ? self[index] : nil
|
|
}
|
|
}
|