Skip to content

Commit

Permalink
fix clearblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ailrst committed Jan 23, 2024
1 parent 4158d49 commit 1f78b30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/ir/Program.scala
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class Procedure private (
* @return an iterator to the new block set
*/
def replaceBlocks(newBlocks: Iterable[Block]): Unit = {
removeBlocks(_blocks)
clearBlocks()
addBlocks(newBlocks)
}

Expand All @@ -245,7 +245,8 @@ class Procedure private (
}

def clearBlocks() : Unit = {
removeBlocks(blocks)
// O(n) because we are careful to unlink the parents etc.
removeBlocks(_blocks)
}


Expand Down

0 comments on commit 1f78b30

Please sign in to comment.