use union/diff operator on Sets (optimization)
This commit is contained in:
parent
b7fecaff37
commit
777a400b12
6 changed files with 15 additions and 18 deletions
|
|
@ -19,7 +19,7 @@ case class TwoPhaseSet(
|
|||
def remove(element: String): TwoPhaseSet =
|
||||
copy(removals = removals.add(element))
|
||||
|
||||
def elements: Set[String] = adds.elements -- removals.elements
|
||||
def elements: Set[String] = adds.elements diff removals.elements
|
||||
|
||||
override def merge(that: TwoPhaseSet): TwoPhaseSet =
|
||||
copy(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue