diff options
author | Paul Phillips <paulp@improving.org> | 2009-11-25 22:26:10 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-11-25 22:26:10 +0000 |
commit | 8648e1c8fa356bff18eb07f69f07817265283809 (patch) | |
tree | ebb9362af4d138583e041fb285a49f904c04c32d | |
parent | aabd642596a884485fa8ab4bc18c30e065bdca15 (diff) | |
download | scala-8648e1c8fa356bff18eb07f69f07817265283809.tar.gz scala-8648e1c8fa356bff18eb07f69f07817265283809.tar.bz2 scala-8648e1c8fa356bff18eb07f69f07817265283809.zip |
Fix for #2704.
-rw-r--r-- | src/library/scala/collection/mutable/Publisher.scala | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/library/scala/collection/mutable/Publisher.scala b/src/library/scala/collection/mutable/Publisher.scala index 29e7e9b371..1800c1ca09 100644 --- a/src/library/scala/collection/mutable/Publisher.scala +++ b/src/library/scala/collection/mutable/Publisher.scala @@ -40,7 +40,7 @@ trait Publisher[Evt] { private val suspended = new HashSet[Sub] def subscribe(sub: Sub) { subscribe(sub, event => true) } - def subscribe(sub: Sub, filter: Filter) { filters(sub) += filter } + def subscribe(sub: Sub, filter: Filter) { filters.addBinding(sub, filter) } def suspendSubscription(sub: Sub) { suspended += sub } def activateSubscription(sub: Sub) { suspended -= sub } def removeSubscription(sub: Sub) { filters -= sub } @@ -58,11 +58,7 @@ trait Publisher[Evt] { * @return true, iff both publishers contain the same sequence of elements. */ override def equals(obj: Any): Boolean = obj match { - case that: Publisher[_] => - (this.filters equals that.filters) && - (this.suspended equals that.suspended) - case _ => - false + case that: Publisher[_] => filters == that.filters && suspended == that.suspended + case _ => false } - } |