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.
2 parents f5ce29b + 40f0514 commit ecf3fa6Copy full SHA for ecf3fa6
src/library/scala/collection/mutable/ListBuffer.scala
@@ -119,6 +119,10 @@ final class ListBuffer[A]
119
// Don't use the inherited size, which forwards to a List and is O(n).
120
override def size = length
121
122
+ // Override with efficient implementations using the extra size information available to ListBuffer.
123
+ override def isEmpty: Boolean = len == 0
124
+ override def nonEmpty: Boolean = len > 0
125
+
126
// Implementations of abstract methods in Buffer
127
128
override def apply(n: Int): A =
0 commit comments