From e76fa4d3ec6a23ea4eae805de97a129092a5de1f Mon Sep 17 00:00:00 2001 From: l-kent Date: Tue, 21 Nov 2023 15:44:48 +1000 Subject: [PATCH] fix merge --- .../analysis/solvers/FixPointSolver.scala | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/scala/analysis/solvers/FixPointSolver.scala b/src/main/scala/analysis/solvers/FixPointSolver.scala index d90005c93..f86f1f260 100644 --- a/src/main/scala/analysis/solvers/FixPointSolver.scala +++ b/src/main/scala/analysis/solvers/FixPointSolver.scala @@ -1,6 +1,6 @@ package analysis.solvers -import analysis._ +import analysis.* import scala.collection.immutable.ListSet import scala.collection.mutable.LinkedHashSet @@ -86,7 +86,7 @@ trait Worklist[N]: */ trait ListSetWorklist[N] extends Worklist[N]: - private var worklist = new ListSet[N] + private var worklist = ListSet[N]() def add(n: N): Unit = worklist += n @@ -107,19 +107,19 @@ trait ListSetWorklist[N] extends Worklist[N]: * type of the elements in the worklist. */ trait LinkedHashSetWorklist[N] extends Worklist[N]: - private val worklist = new LinkedHashSet[N] + private val worklist = LinkedHashSet[N]() - def add(n: N) = + def add(n: N): Unit = worklist += n - def add(ns: Set[N]) = worklist ++= ns + def add(ns: Set[N]): Unit = worklist ++= ns - def run(first: Set[N], intra: Boolean) = - worklist.addAll(first); - while (worklist.nonEmpty) do - val n = worklist.head; + def run(first: Set[N]): Unit = + worklist.addAll(first) + while worklist.nonEmpty do + val n = worklist.head worklist.remove(n) - process(n, intra) + process(n) /** Base trait for worklist-based fixpoint solvers.