Full generation, file type cleanup
This commit is contained in:
@ -27,3 +27,20 @@ extension Collection {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
extension Collection where Element: Collection, Element.Element: Hashable {
|
||||
|
||||
func union() -> Set<Element.Element> {
|
||||
reduce(into: []) { $0.formUnion($1) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension RangeReplaceableCollection where Element: Comparable {
|
||||
|
||||
|
||||
mutating func insertSorted(_ element: Element) {
|
||||
let index = firstIndex(where: { $0 > element }) ?? endIndex
|
||||
insert(element, at: index)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user