mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SwiftCompilerSources: add a few utility APIs
This commit is contained in:
@@ -228,3 +228,16 @@ struct OperandSet : IntrusiveSet {
|
||||
context.freeOperandSet(bridged)
|
||||
}
|
||||
}
|
||||
|
||||
extension IntrusiveSet {
|
||||
mutating func insert(contentsOf source: some Sequence<Element>) {
|
||||
for element in source {
|
||||
_ = insert(element)
|
||||
}
|
||||
}
|
||||
|
||||
init(insertContentsOf source: some Sequence<Element>, _ context: some Context) {
|
||||
self.init(context)
|
||||
insert(contentsOf: source)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user