summaryrefslogtreecommitdiff
path: root/src/library/scala
diff options
context:
space:
mode:
authorJohannes Rudolph <johannes.rudolph@gmail.com>2017-03-22 15:34:21 +0100
committerGitHub <noreply@github.com>2017-03-22 15:34:21 +0100
commitf171c5115508700d1b700c07c454d06295484448 (patch)
tree26bd0ddeaf6f0bbf7aaef23c228dd0369c22e8a1 /src/library/scala
parentb68cc6ce6f26140ce6dfa28662ebf60de5a23ad2 (diff)
downloadscala-f171c5115508700d1b700c07c454d06295484448.tar.gz
scala-f171c5115508700d1b700c07c454d06295484448.tar.bz2
scala-f171c5115508700d1b700c07c454d06295484448.zip
Improve List creation in BatchingExecutor
It turned up in play profiling.
Diffstat (limited to 'src/library/scala')
-rw-r--r--src/library/scala/concurrent/BatchingExecutor.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/concurrent/BatchingExecutor.scala b/src/library/scala/concurrent/BatchingExecutor.scala
index a0d7aaea47..fd31f3470e 100644
--- a/src/library/scala/concurrent/BatchingExecutor.scala
+++ b/src/library/scala/concurrent/BatchingExecutor.scala
@@ -103,7 +103,7 @@ private[concurrent] trait BatchingExecutor extends Executor {
override def execute(runnable: Runnable): Unit = {
if (batchable(runnable)) { // If we can batch the runnable
_tasksLocal.get match {
- case null => unbatchedExecute(new Batch(List(runnable))) // If we aren't in batching mode yet, enqueue batch
+ case null => unbatchedExecute(new Batch(runnable :: Nil)) // If we aren't in batching mode yet, enqueue batch
case some => _tasksLocal.set(runnable :: some) // If we are already in batching mode, add to batch
}
} else unbatchedExecute(runnable) // If not batchable, just delegate to underlying