mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
0db74ce1e3
Fixed a couple of issues around the duplicate messages handling Fixed a few issues with ClosedGroup polling and ClosedGroup control message handling Started working through updating the MediaGallery
32 lines
885 B
Swift
32 lines
885 B
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
public extension Set {
|
|
func inserting(_ value: Element?) -> Set<Element> {
|
|
guard let value: Element = value else { return self }
|
|
|
|
var updatedSet: Set<Element> = self
|
|
updatedSet.insert(value)
|
|
|
|
return updatedSet
|
|
}
|
|
|
|
func inserting(contentsOf value: Set<Element>?) -> Set<Element> {
|
|
guard let value: Set<Element> = value else { return self }
|
|
|
|
var updatedSet: Set<Element> = self
|
|
value.forEach { updatedSet.insert($0) }
|
|
|
|
return updatedSet
|
|
}
|
|
|
|
func removing(_ value: Element?) -> Set<Element> {
|
|
guard let value: Element = value else { return self }
|
|
|
|
var updatedSet: Set<Element> = self
|
|
updatedSet.remove(value)
|
|
|
|
return updatedSet
|
|
}
|
|
}
|