summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/parallel/mutable/ParHashTable.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/parallel/mutable/ParHashTable.scala')
-rw-r--r--src/library/scala/collection/parallel/mutable/ParHashTable.scala14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/library/scala/collection/parallel/mutable/ParHashTable.scala b/src/library/scala/collection/parallel/mutable/ParHashTable.scala
index 8f7ff72103..a9ab577b55 100644
--- a/src/library/scala/collection/parallel/mutable/ParHashTable.scala
+++ b/src/library/scala/collection/parallel/mutable/ParHashTable.scala
@@ -30,9 +30,11 @@ trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends collection.m
def entry2item(e: Entry): T
def newIterator(idxFrom: Int, idxUntil: Int, totalSize: Int, es: Entry): IterRepr
- def hasNext = es != null
+ def hasNext = {
+ es ne null
+ }
- def next = {
+ def next: T = {
val res = es
es = es.next
scan()
@@ -113,7 +115,9 @@ trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends collection.m
val fbindex = from / sizeMapBucketSize
// find the last bucket
- val lbindex = from / sizeMapBucketSize
+ val lbindex = until / sizeMapBucketSize
+ // note to self: FYI if you define lbindex as from / sizeMapBucketSize, the first branch
+ // below always triggers and tests pass, so you spend a great day benchmarking and profiling
if (fbindex == lbindex) {
// if first and last are the same, just count between `from` and `until`
@@ -164,5 +168,7 @@ trait ParHashTable[K, Entry >: Null <: HashEntry[K, Entry]] extends collection.m
-
+object ParHashTable {
+ var iters = 0
+}