summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-09 15:12:24 -0700
committerJason Zaugg <jzaugg@gmail.com>2013-06-09 15:12:24 -0700
commita54d86b5508630a4815ca7f6ca3d5f05b74b1d9f (patch)
treec00283863cc4b713db2dcc1aa3e583341cd28780 /src
parente3c318649c4318412c8d7e3cbee4689489f6ccb1 (diff)
parentc71fa58a35690672bc4626d18b5016b98bfcc5f8 (diff)
downloadscala-a54d86b5508630a4815ca7f6ca3d5f05b74b1d9f.tar.gz
scala-a54d86b5508630a4815ca7f6ca3d5f05b74b1d9f.tar.bz2
scala-a54d86b5508630a4815ca7f6ca3d5f05b74b1d9f.zip
Merge pull request #2644 from retronym/ticket/7498-backport
[backport] SI-7498 ParTrieMap.foreach no longer crashes
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/collection/concurrent/TrieMap.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/library/scala/collection/concurrent/TrieMap.scala b/src/library/scala/collection/concurrent/TrieMap.scala
index 6c11c5bcb5..714260fa8a 100644
--- a/src/library/scala/collection/concurrent/TrieMap.scala
+++ b/src/library/scala/collection/concurrent/TrieMap.scala
@@ -1011,8 +1011,11 @@ private[collection] class TrieMapIterator[K, V](var level: Int, private var ct:
*/
protected def subdivide(): Seq[Iterator[(K, V)]] = if (subiter ne null) {
// the case where an LNode is being iterated
- val it = subiter
- subiter = null
+ val it = newIterator(level + 1, ct, _mustInit = false)
+ it.depth = -1
+ it.subiter = this.subiter
+ it.current = null
+ this.subiter = null
advance()
this.level += 1
Seq(it, this)