Skip to content

Commit

Permalink
Removed unnecessary code from InsertionOrderSet to further improve th…
Browse files Browse the repository at this point in the history
…e performance as pointed out by @kpbochenek .
  • Loading branch information
cheeseng committed Jan 26, 2024
1 parent 128a422 commit 7862997
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions project/GenColCompatHelper.scala
Expand Up @@ -75,9 +75,9 @@ object GenColCompatHelper {
| def excl(elem: A): scala.collection.immutable.Set[A] = new InsertionOrderSet(elements.filter(_ != elem))
| def incl(elem: A): scala.collection.immutable.Set[A] =
| if (underlying.contains(elem))
| new InsertionOrderSet(elements)
| this
| else
| new InsertionOrderSet(if (underlying.contains(elem)) elements else elements :+ elem)
| new InsertionOrderSet(elements :+ elem)
| }
|}
|
Expand Down Expand Up @@ -149,9 +149,9 @@ object GenColCompatHelper {
| def -(elem: A): scala.collection.immutable.Set[A] = new InsertionOrderSet(elements.filter(_ != elem))
| def +(elem: A): scala.collection.immutable.Set[A] =
| if (underlying.contains(elem))
| new InsertionOrderSet(elements)
| this
| else
| new InsertionOrderSet(if (underlying.contains(elem)) elements else elements :+ elem)
| new InsertionOrderSet(elements :+ elem)
| }
|}
|
Expand Down

0 comments on commit 7862997

Please sign in to comment.