diff options
author | Pap Lőrinc <paplorinc@gmail.com> | 2016-11-18 15:41:39 +0200 |
---|---|---|
committer | Pap Lőrinc <paplorinc@gmail.com> | 2016-12-06 23:14:51 +0200 |
commit | 6af55b027122f7c2d7d9f9a2c7bfcfd913cce5ae (patch) | |
tree | b61840a31bdc94c482cdf7a3d4de60c50dfaa05a /src | |
parent | f4ae496f920d49d120f7453d2599740bf249287a (diff) | |
download | scala-6af55b027122f7c2d7d9f9a2c7bfcfd913cce5ae.tar.gz scala-6af55b027122f7c2d7d9f9a2c7bfcfd913cce5ae.tar.bz2 scala-6af55b027122f7c2d7d9f9a2c7bfcfd913cce5ae.zip |
Unified masks in Vector
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/immutable/Vector.scala | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/library/scala/collection/immutable/Vector.scala b/src/library/scala/collection/immutable/Vector.scala index 1d713e3e59..4c853cccd9 100644 --- a/src/library/scala/collection/immutable/Vector.scala +++ b/src/library/scala/collection/immutable/Vector.scala @@ -253,7 +253,7 @@ override def companion: GenericCompanion[Vector] = Vector s.initFrom(this) s.dirty = dirty s.gotoPosWritable(focus, idx, focus ^ idx) // if dirty commit changes; go to new pos and prepare for writing - s.display0(idx & 0x1f) = elem.asInstanceOf[AnyRef] + s.display0(idx & 31) = elem.asInstanceOf[AnyRef] s } @@ -519,33 +519,33 @@ override def companion: GenericCompanion[Vector] = Vector zeroLeft(display0, cutIndex) } else if (cutIndex < (1 << 10)) { - zeroLeft(display0, cutIndex & 0x1f) + zeroLeft(display0, cutIndex & 31) display1 = copyRight(display1, (cutIndex >>> 5)) } else if (cutIndex < (1 << 15)) { - zeroLeft(display0, cutIndex & 0x1f) - display1 = copyRight(display1, (cutIndex >>> 5) & 0x1f) + zeroLeft(display0, cutIndex & 31) + display1 = copyRight(display1, (cutIndex >>> 5) & 31) display2 = copyRight(display2, (cutIndex >>> 10)) } else if (cutIndex < (1 << 20)) { - zeroLeft(display0, cutIndex & 0x1f) - display1 = copyRight(display1, (cutIndex >>> 5) & 0x1f) - display2 = copyRight(display2, (cutIndex >>> 10) & 0x1f) + zeroLeft(display0, cutIndex & 31) + display1 = copyRight(display1, (cutIndex >>> 5) & 31) + display2 = copyRight(display2, (cutIndex >>> 10) & 31) display3 = copyRight(display3, (cutIndex >>> 15)) } else if (cutIndex < (1 << 25)) { - zeroLeft(display0, cutIndex & 0x1f) - display1 = copyRight(display1, (cutIndex >>> 5) & 0x1f) - display2 = copyRight(display2, (cutIndex >>> 10) & 0x1f) - display3 = copyRight(display3, (cutIndex >>> 15) & 0x1f) + zeroLeft(display0, cutIndex & 31) + display1 = copyRight(display1, (cutIndex >>> 5) & 31) + display2 = copyRight(display2, (cutIndex >>> 10) & 31) + display3 = copyRight(display3, (cutIndex >>> 15) & 31) display4 = copyRight(display4, (cutIndex >>> 20)) } else if (cutIndex < (1 << 30)) { - zeroLeft(display0, cutIndex & 0x1f) - display1 = copyRight(display1, (cutIndex >>> 5) & 0x1f) - display2 = copyRight(display2, (cutIndex >>> 10) & 0x1f) - display3 = copyRight(display3, (cutIndex >>> 15) & 0x1f) - display4 = copyRight(display4, (cutIndex >>> 20) & 0x1f) + zeroLeft(display0, cutIndex & 31) + display1 = copyRight(display1, (cutIndex >>> 5) & 31) + display2 = copyRight(display2, (cutIndex >>> 10) & 31) + display3 = copyRight(display3, (cutIndex >>> 15) & 31) + display4 = copyRight(display4, (cutIndex >>> 20) & 31) display5 = copyRight(display5, (cutIndex >>> 25)) } else { throw new IllegalArgumentException() @@ -562,33 +562,33 @@ override def companion: GenericCompanion[Vector] = Vector zeroRight(display0, cutIndex) } else if (cutIndex <= (1 << 10)) { - zeroRight(display0, ((cutIndex-1) & 0x1f) + 1) + zeroRight(display0, ((cutIndex-1) & 31) + 1) display1 = copyLeft(display1, (cutIndex >>> 5)) } else if (cutIndex <= (1 << 15)) { - zeroRight(display0, ((cutIndex-1) & 0x1f) + 1) - display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 0x1f) + 1) + zeroRight(display0, ((cutIndex-1) & 31) + 1) + display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 31) + 1) display2 = copyLeft(display2, (cutIndex >>> 10)) } else if (cutIndex <= (1 << 20)) { - zeroRight(display0, ((cutIndex-1) & 0x1f) + 1) - display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 0x1f) + 1) - display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 0x1f) + 1) + zeroRight(display0, ((cutIndex-1) & 31) + 1) + display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 31) + 1) + display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 31) + 1) display3 = copyLeft(display3, (cutIndex >>> 15)) } else if (cutIndex <= (1 << 25)) { - zeroRight(display0, ((cutIndex-1) & 0x1f) + 1) - display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 0x1f) + 1) - display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 0x1f) + 1) - display3 = copyLeft(display3, (((cutIndex-1) >>> 15) & 0x1f) + 1) + zeroRight(display0, ((cutIndex-1) & 31) + 1) + display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 31) + 1) + display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 31) + 1) + display3 = copyLeft(display3, (((cutIndex-1) >>> 15) & 31) + 1) display4 = copyLeft(display4, (cutIndex >>> 20)) } else if (cutIndex <= (1 << 30)) { - zeroRight(display0, ((cutIndex-1) & 0x1f) + 1) - display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 0x1f) + 1) - display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 0x1f) + 1) - display3 = copyLeft(display3, (((cutIndex-1) >>> 15) & 0x1f) + 1) - display4 = copyLeft(display4, (((cutIndex-1) >>> 20) & 0x1f) + 1) + zeroRight(display0, ((cutIndex-1) & 31) + 1) + display1 = copyLeft(display1, (((cutIndex-1) >>> 5) & 31) + 1) + display2 = copyLeft(display2, (((cutIndex-1) >>> 10) & 31) + 1) + display3 = copyLeft(display3, (((cutIndex-1) >>> 15) & 31) + 1) + display4 = copyLeft(display4, (((cutIndex-1) >>> 20) & 31) + 1) display5 = copyLeft(display5, (cutIndex >>> 25)) } else { throw new IllegalArgumentException() |