summaryrefslogtreecommitdiff
path: root/src/parallel-collections
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-06-16 10:07:42 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2010-06-16 10:07:42 +0000
commit85d5a0cfcd549224d28774b4b13ced5e8367298f (patch)
treec2546160126066fb7616e8747512ddff4fb51ca4 /src/parallel-collections
parent0c6cbdac433a001f76b1f9afd00f4280d17d1832 (diff)
downloadscala-85d5a0cfcd549224d28774b4b13ced5e8367298f.tar.gz
scala-85d5a0cfcd549224d28774b4b13ced5e8367298f.tar.bz2
scala-85d5a0cfcd549224d28774b4b13ced5e8367298f.zip
Fixed hash trie splitting. No review.
Diffstat (limited to 'src/parallel-collections')
-rw-r--r--src/parallel-collections/scala/collection/parallel/immutable/ParallelHashTrie.scala19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/parallel-collections/scala/collection/parallel/immutable/ParallelHashTrie.scala b/src/parallel-collections/scala/collection/parallel/immutable/ParallelHashTrie.scala
index 577fb2642b..362e36135e 100644
--- a/src/parallel-collections/scala/collection/parallel/immutable/ParallelHashTrie.scala
+++ b/src/parallel-collections/scala/collection/parallel/immutable/ParallelHashTrie.scala
@@ -42,23 +42,26 @@ extends ParallelMap[K, V]
type SCPI = SignalContextPassingIterator[ParallelHashTrieIterator]
- class ParallelHashTrieIterator(trie: HashMap[K, V])
+ class ParallelHashTrieIterator(val ht: HashMap[K, V])
extends super.ParallelIterator {
self: SignalContextPassingIterator[ParallelHashTrieIterator] =>
- println("created iterator")
+ // println("created iterator " + ht)
var i = 0
- lazy val triter = trie.iterator
+ lazy val triter = ht.iterator
def split: Seq[ParallelIterator] = {
- println("splitting " + trie + " into " + (trie.split.map(_.size)))
- trie.split.map(new ParallelHashTrieIterator(_) with SCPI)
+ // println("splitting " + ht + " into " + ht.split.map(new ParallelHashTrieIterator(_) with SCPI).map(_.toList))
+ ht.split.map(new ParallelHashTrieIterator(_) with SCPI)
}
def next: (K, V) = {
- println("taking next after " + i)
+ // println("taking next after " + i + ", in " + ht)
i += 1
triter.next
}
- def hasNext: Boolean = i < trie.size
- def remaining = trie.size - i
+ def hasNext: Boolean = {
+ // println("hasNext: " + i + ", " + ht.size + ", " + ht)
+ i < ht.size
+ }
+ def remaining = ht.size - i
}
}