mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-23 14:05:33 +00:00
23 lines
462 B
Swift
23 lines
462 B
Swift
import Foundation
|
|
|
|
public struct SimpleSet<T: Equatable> {
|
|
private var items: [T] = []
|
|
|
|
public init() {
|
|
}
|
|
|
|
public mutating func insert(item: T) {
|
|
if !self.contains(item) {
|
|
self.items.append(item)
|
|
}
|
|
}
|
|
|
|
public func contains(item: T) -> Bool {
|
|
for currentItem in self.items {
|
|
if currentItem == item {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
} |