mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Swift Optimizer: make the set's insert functions return a Bool.
Returning true if the element was not contained in the set before inserting
This commit is contained in:
@@ -78,8 +78,7 @@ struct BasicBlockRange : CustomStringConvertible, CustomReflectable {
|
||||
|
||||
/// Insert a potential end block.
|
||||
mutating func insert(_ block: BasicBlock) {
|
||||
if !wasInserted.contains(block) {
|
||||
wasInserted.insert(block)
|
||||
if wasInserted.insert(block) {
|
||||
inserted.append(block)
|
||||
}
|
||||
worklist.pushIfNotVisited(block)
|
||||
|
||||
Reference in New Issue
Block a user