Skip to content

Commit 341f750

Browse files
committed
Add prop test to ensure that HashMap#transform returns when all values transform to themselves
1 parent b4f2e58 commit 341f750

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/src/scala/collection/immutable/ChampHashMap.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ private final class HashCollisionMapNode[K, +V ](
840840
def foreach[U](f: ((K, V)) => U): Unit = content.foreach(f)
841841

842842
override def transform[W](f: (K, V) => W): HashCollisionMapNode[K, W] = {
843-
var newContent = Vector.newBuilder[(K, W)]
843+
val newContent = Vector.newBuilder[(K, W)]
844844
val contentIter = content.iterator
845845
// true if any values have been transformed to a different value via `f`
846846
var anyChanges = false

0 commit comments

Comments
 (0)