Do not use `ListBuffer#readOnly`

It's dangerous, deprecated, and was removed in 2.12.0-M1.
See https://github.com/scala/scala/pull/4140.

`ListBuffer#toList` has equivalent performance,
except it actually returns an immutable copy(-on-write).
This commit is contained in:
Adriaan Moors 2015-07-09 14:49:08 -07:00
parent 47a9a6db05
commit a355012c2e
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ class BufferedLogger(delegate: AbstractLogger) extends BasicLogger {
* Flushes the buffer to the delegate logger. This method calls logAll on the delegate
* so that the messages are written consecutively. The buffer is cleared in the process.
*/
def play(): Unit = synchronized { delegate.logAll(buffer.readOnly); buffer.clear() }
def play(): Unit = synchronized { delegate.logAll(buffer.toList); buffer.clear() }
/** Clears buffered events and disables buffering. */
def clear(): Unit = synchronized { buffer.clear(); recording = false }
/** Plays buffered events and disables buffering. */