File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
library/src/scala/collection/immutable Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -355,16 +355,16 @@ private[collection] object RedBlackTree {
355
355
else if (tree.left eq null ) tree
356
356
else findLeftMostOrPopOnEmpty(goLeft(tree))
357
357
358
- private [this ] def pushNext (tree : Tree [A , B ]): Unit = {
358
+ @ `inline` private [this ] def pushNext (tree : Tree [A , B ]): Unit = {
359
359
stackOfNexts(index) = tree
360
360
index += 1
361
361
}
362
- protected final def popNext (): Tree [A , B ] = if (index == 0 ) null else {
362
+ @ `inline` protected final def popNext (): Tree [A , B ] = if (index == 0 ) null else {
363
363
index -= 1
364
364
stackOfNexts(index)
365
365
}
366
366
367
- private [this ] var stackOfNexts = if (root eq null ) null else {
367
+ protected [this ] val stackOfNexts = if (root eq null ) null else {
368
368
/*
369
369
* According to "Ralf Hinze. Constructing red-black trees" [http://www.cs.ox.ac.uk/ralf.hinze/publications/#P5]
370
370
* the maximum height of a red-black tree is 2*log_2(n + 2) - 2.
@@ -378,7 +378,7 @@ private[collection] object RedBlackTree {
378
378
new Array [Tree [A , B ]](maximumHeight)
379
379
}
380
380
private [this ] var index = 0
381
- protected var lookahead : Tree [A , B ] = start map startFrom getOrElse findLeftMostOrPopOnEmpty(root)
381
+ protected var lookahead : Tree [A , B ] = if ( start isDefined) startFrom(start.get) else findLeftMostOrPopOnEmpty(root)
382
382
383
383
/**
384
384
* Find the leftmost subtree whose key is equal to the given key, or if no such thing,
You can’t perform that action at this time.
0 commit comments