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:
Erik Eckstein
2022-08-23 09:00:10 +02:00
parent fe40707d5e
commit de6e539a0a
5 changed files with 23 additions and 19 deletions

View File

@@ -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)