diff options
author | Martin Odersky <odersky@gmail.com> | 2009-05-12 09:58:25 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-05-12 09:58:25 +0000 |
commit | ca3d31e7b25e4709839671f2ee5c5bd643cbc08e (patch) | |
tree | e44fe21fe1202a7c4ebc026a9bc2bd851b16bdec /src/library/scala/collection/mutable/ListBuffer.scala | |
parent | e4a8be83c10545e318fcb53bea39e86b26a71555 (diff) | |
download | scala-ca3d31e7b25e4709839671f2ee5c5bd643cbc08e.tar.gz scala-ca3d31e7b25e4709839671f2ee5c5bd643cbc08e.tar.bz2 scala-ca3d31e7b25e4709839671f2ee5c5bd643cbc08e.zip |
separated mutable and immutable maps
Diffstat (limited to 'src/library/scala/collection/mutable/ListBuffer.scala')
-rw-r--r-- | src/library/scala/collection/mutable/ListBuffer.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library/scala/collection/mutable/ListBuffer.scala b/src/library/scala/collection/mutable/ListBuffer.scala index 32ce0b4373..22396f1322 100644 --- a/src/library/scala/collection/mutable/ListBuffer.scala +++ b/src/library/scala/collection/mutable/ListBuffer.scala @@ -87,7 +87,7 @@ final class ListBuffer[A] * * @param x the element to append. */ - def += (x: A) { + def += (x: A): this.type = { if (exported) copy() if (start.isEmpty) { last0 = new :: (x, Nil) @@ -98,6 +98,7 @@ final class ListBuffer[A] last1.tl = last0 } len += 1 + this } /** Clears the buffer contents. @@ -254,7 +255,7 @@ final class ListBuffer[A] * * @param x the element to remove. */ - override def -= (elem: A) { + override def -= (elem: A): this.type = { if (exported) copy() if (start.isEmpty) {} else if (start.head == elem) { @@ -273,6 +274,7 @@ final class ListBuffer[A] len -= 1 } } + this } override def elements = new Iterator[A] { |