diff options
author | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-09-01 11:55:15 +0000 |
---|---|---|
committer | Geoffrey Washburn <geoffrey.washburn@epfl.ch> | 2008-09-01 11:55:15 +0000 |
commit | cd085f614377eeef6f9ac87fc11bd776e514e7fd (patch) | |
tree | 71091a222308851f2da3dcc9f267f8fd6bfdbbcb /src | |
parent | f58162a784e46916d85ad9dbec063143ecf8211e (diff) | |
download | scala-cd085f614377eeef6f9ac87fc11bd776e514e7fd.tar.gz scala-cd085f614377eeef6f9ac87fc11bd776e514e7fd.tar.bz2 scala-cd085f614377eeef6f9ac87fc11bd776e514e7fd.zip |
Small change to the code generated by the inter...
Small change to the code generated by the interperter not to call
toString on the result twice. Probably not much of a concern in terms of
efficiency, but useful if toString is effectful.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 1fbc80ab82..99606e856f 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -625,11 +625,10 @@ class Interpreter(val settings: Settings, out: PrintWriter) { " (if(" + req.fullPath(vname) + ".asInstanceOf[AnyRef] != null) " + - " ((if(" + + " { val tmp = " + req.fullPath(vname) + - ".toString().contains('\\n')) " + - " \"\\n\" else \"\") + " + - req.fullPath(vname) + ".toString() + \"\\n\") else \"null\\n\") ") + ".toString(); " + + " (if(tmp.contains('\\n')) \"\\n\" else \"\") + tmp + \"\\n\"} else \"null\\n\") ") } } } |