refactor
This commit is contained in:
parent
38e08f17a2
commit
6e21fba469
@ -108,15 +108,9 @@ public func ==(lhs: SocketIOClientOption, rhs: SocketIOClientOption) -> Bool {
|
|||||||
|
|
||||||
extension Set where Element: ClientOption {
|
extension Set where Element: ClientOption {
|
||||||
mutating func insertIgnore(element: Element) {
|
mutating func insertIgnore(element: Element) {
|
||||||
let (insertType, _) = Mirror(reflecting: element).children.first!
|
if !contains({$0.description == element.description}) {
|
||||||
for item in self {
|
insert(element)
|
||||||
let (name, _) = Mirror(reflecting: item).children.first!
|
|
||||||
if insertType == name {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.insert(element)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static func NSDictionaryToSocketOptionsSet(dict: NSDictionary) -> Set<SocketIOClientOption> {
|
static func NSDictionaryToSocketOptionsSet(dict: NSDictionary) -> Set<SocketIOClientOption> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user