Skip to content

Commit eb525fd

Browse files
authored
Merge pull request scala/scala#9376 from mkeskells/2.12.x_optimise_optimised_groupBy
optimize the optimized groupBy
2 parents 6b35b58 + 414b084 commit eb525fd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/src/scala/collection/TraversableLike.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,10 @@ trait TraversableLike[+A, +Repr] extends Any
491491
else if (k3 == key) v3
492492
else {
493493
hashMap = new mutable.HashMap
494-
hashMap += ((k0, v0))
495-
hashMap += ((k1, v1))
496-
hashMap += ((k2, v2))
497-
hashMap += ((k3, v3))
494+
hashMap(k0) = v0
495+
hashMap(k1) = v1
496+
hashMap(k2) = v2
497+
hashMap(k3) = v3
498498
val bldr = apply()
499499
hashMap(key) = bldr
500500
bldr

0 commit comments

Comments
 (0)