summaryrefslogtreecommitdiff
path: root/src/repl
diff options
context:
space:
mode:
authorRaphael Jolly <rjolly@users.sourceforge.net>2013-05-16 10:14:10 +0200
committerRaphael Jolly <rjolly@users.sourceforge.net>2013-05-16 10:14:10 +0200
commite85df241f84953fd9ffc6ff9a72fe1438eaf9588 (patch)
treec53c4b99a22cbe280128a07a317d7929b80d7ef9 /src/repl
parent6a3efe3b3e83c37182268f0e0bab9acc69653115 (diff)
downloadscala-e85df241f84953fd9ffc6ff9a72fe1438eaf9588.tar.gz
scala-e85df241f84953fd9ffc6ff9a72fe1438eaf9588.tar.bz2
scala-e85df241f84953fd9ffc6ff9a72fe1438eaf9588.zip
Read-eval-print : the script engine does not need print so make it lazy
This can have a dramatic effect on computing time in cases with big intermediate results but simple final one.
Diffstat (limited to 'src/repl')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/IMain.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/IMain.scala b/src/repl/scala/tools/nsc/interpreter/IMain.scala
index 66129e0be8..379751b9a7 100644
--- a/src/repl/scala/tools/nsc/interpreter/IMain.scala
+++ b/src/repl/scala/tools/nsc/interpreter/IMain.scala
@@ -899,7 +899,7 @@ class IMain(@BeanProperty val factory: ScriptEngineFactory, initialSettings: Set
val preamble = """
|object %s {
| %s
- | val %s: String = %s {
+ | lazy val %s: String = %s {
| %s
| (""
""".stripMargin.format(