We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d526f8b commit 48cffd0Copy full SHA for 48cffd0
src/library/scala/collection/mutable/MutableList.scala
@@ -65,7 +65,7 @@ extends AbstractSeq[A]
65
require(nonEmpty, "tail of empty list")
66
tl.first0 = first0.tail
67
tl.len = len - 1
68
- tl.last0 = if (tl.len == 0) new LinkedList[A]() else last0
+ tl.last0 = if (tl.len == 0) tl.first0 else last0
69
}
70
71
/** Prepends a single element to this list. This operation takes constant
src/library/scala/collection/mutable/Queue.scala
@@ -183,7 +183,7 @@ extends MutableList[A]
183
184
private[this] def decrementLength() {
185
len -= 1
186
- if (len == 0) last0 = new LinkedList[A]()
+ if (len == 0) last0 = first0
187
188
189
0 commit comments