Undone the revert on the optimization, and fixed setAll()

The optimization, and therefore the change in the behavior
of Relation, is now needed by the class Logic, and cannot
be reverted.

This patch (written by Josh) therefore changes the
implementation of setAll() so that _1s is no longer used.
This commit is contained in:
Antonio Cunei 2014-09-12 20:51:04 +02:00
parent e0dd2e6a4c
commit 77691eac40
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ private final class MRelation[A, B](fwd: Map[A, Set[B]], rev: Map[B, Set[A]]) ex
def +(pair: (A, B)) = this + (pair._1, Set(pair._2))
def +(from: A, to: B) = this + (from, to :: Nil)
def +(from: A, to: Traversable[B]) =
def +(from: A, to: Traversable[B]) = if (to.isEmpty) this else
new MRelation(add(fwd, from, to), (rev /: to) { (map, t) => add(map, t, from :: Nil) })
def ++(rs: Traversable[(A, B)]) = ((this: Relation[A, B]) /: rs) { _ + _ }