Skip to content

Commit 7ec4207

Browse files
committed
Merge pull request scala#4714 from Ichoran/issue/9407
SI-9407 Vector implementation bit-shift bugfix
2 parents d69aa70 + 60cdb31 commit 7ec4207

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/library/scala/collection/immutable/Vector.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,6 @@ private[immutable] trait VectorPointer[T] {
11561156
if (depth == 3) {
11571157
display3 = new Array(32)
11581158
display3((oldIndex >> 15) & 31) = display2
1159-
display2 = new Array(32)
1160-
display1 = new Array(32)
11611159
depth +=1
11621160
}
11631161
display2 = display3((newIndex >> 15) & 31).asInstanceOf[Array[AnyRef]]
@@ -1170,9 +1168,6 @@ private[immutable] trait VectorPointer[T] {
11701168
if (depth == 4) {
11711169
display4 = new Array(32)
11721170
display4((oldIndex >> 20) & 31) = display3
1173-
display3 = new Array(32)
1174-
display2 = new Array(32)
1175-
display1 = new Array(32)
11761171
depth +=1
11771172
}
11781173
display3 = display4((newIndex >> 20) & 31).asInstanceOf[Array[AnyRef]]
@@ -1187,13 +1182,9 @@ private[immutable] trait VectorPointer[T] {
11871182
if (depth == 5) {
11881183
display5 = new Array(32)
11891184
display5((oldIndex >> 25) & 31) = display4
1190-
display4 = new Array(32)
1191-
display3 = new Array(32)
1192-
display2 = new Array(32)
1193-
display1 = new Array(32)
11941185
depth +=1
11951186
}
1196-
display4 = display5((newIndex >> 20) & 31).asInstanceOf[Array[AnyRef]]
1187+
display4 = display5((newIndex >> 25) & 31).asInstanceOf[Array[AnyRef]]
11971188
if (display4 == null) display4 = new Array(32)
11981189
display3 = display4((newIndex >> 20) & 31).asInstanceOf[Array[AnyRef]]
11991190
if (display3 == null) display3 = new Array(32)

0 commit comments

Comments
 (0)