2018-08-24 18:42:07 +02:00
|
|
|
/**
|
|
|
|
* Splash
|
|
|
|
* Copyright (c) John Sundell 2018
|
|
|
|
* MIT license - see LICENSE.md
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
internal extension Sequence where Element: Equatable {
|
|
|
|
func contains(anyOf candidates: Element...) -> Bool {
|
|
|
|
return contains(anyOf: candidates)
|
|
|
|
}
|
|
|
|
|
2019-11-04 11:31:08 +01:00
|
|
|
func contains<S: Sequence>(anyOf candidates: S) -> Bool where S.Element == Element {
|
2018-08-24 18:42:07 +02:00
|
|
|
for candidate in candidates {
|
|
|
|
if contains(candidate) {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|