Skip to content

Commit 99df51b

Browse files
committed
Fix crush
1 parent f29b4e3 commit 99df51b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

library/src/scala/collection/mutable/LinkedHashSet.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class LinkedHashSet[A]
5858
* - Every bucket is sorted in ascendant hash order
5959
* - The sum of the lengths of all buckets is equal to contentSize.
6060
*/
61-
private[this] var table = new Array[Entry](tableSizeFor(LinkedHashSet.defaultinitialSize))
61+
private[this] var table = new Array[Entry | Null](tableSizeFor(LinkedHashSet.defaultinitialSize))
6262

6363
private[this] var threshold: Int = newThreshold(table.length)
6464

@@ -278,7 +278,7 @@ class LinkedHashSet[A]
278278
n = next
279279
}
280280
lastLow.next = null
281-
if (old ne preLow.next) table(i) = preLow.next.nn
281+
if (old ne preLow.next) table(i) = preLow.next
282282
if (preHigh.next ne null) {
283283
table(i + oldlen) = preHigh.next
284284
lastHigh.next = null

library/src/scala/collection/mutable/RedBlackTree.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ private[collection] object RedBlackTree {
5656
object Node {
5757

5858
@`inline` def apply[A, B](key: A, value: B, red: Boolean,
59-
left: Node[A, B], right: Node[A, B], parent: Node[A, B]): Node[A, B] =
59+
left: Node[A, B], right: Node[A, B], parent: Node[A, B] | Null): Node[A, B] =
6060
new Node(key, value, red, left, right, parent)
6161

62-
@`inline` def leaf[A, B](key: A, value: B, red: Boolean, parent: Node[A, B]): Node[A, B] =
62+
@`inline` def leaf[A, B](key: A, value: B, red: Boolean, parent: Node[A, B] | Null): Node[A, B] =
6363
new Node(key, value, red, null, null, parent)
6464

6565
def unapply[A, B](t: Node[A, B]) = Some((t.key, t.value, t.left, t.right, t.parent))
@@ -202,7 +202,7 @@ private[collection] object RedBlackTree {
202202

203203
if (cmp == 0) y.nn.value = value
204204
else {
205-
val z = Node.leaf(key, value, red = true, y.nn)
205+
val z = Node.leaf(key, value, red = true, y)
206206

207207
if (y eq null) tree.root = z
208208
else if (cmp < 0) y.left = z

0 commit comments

Comments
 (0)