diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-11 14:40:28 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-11 14:40:28 +0000 |
commit | ced34334189f3d62c4883a50268bda436aefffbd (patch) | |
tree | eae546d2f58e7b6781cd5ad229d0e26830e97996 | |
parent | 719dce0a89f1716eab03c9128c8c63ee7bd69588 (diff) | |
download | scala-ced34334189f3d62c4883a50268bda436aefffbd.tar.gz scala-ced34334189f3d62c4883a50268bda436aefffbd.tar.bz2 scala-ced34334189f3d62c4883a50268bda436aefffbd.zip |
rewrote an infinite loop spotted by findbugs to...
rewrote an infinite loop spotted by findbugs to be more finite
-rw-r--r-- | src/scalap/scala/tools/scalap/CodeWriter.scala | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/scalap/scala/tools/scalap/CodeWriter.scala b/src/scalap/scala/tools/scalap/CodeWriter.scala index b0ad39bd12..24a1a87f05 100644 --- a/src/scalap/scala/tools/scalap/CodeWriter.scala +++ b/src/scalap/scala/tools/scalap/CodeWriter.scala @@ -32,13 +32,8 @@ class CodeWriter(writer: Writer) { def getIndentWidth = if (step == null) -1 else step.length() - def setIndentWidth(width: Int): CodeWriter = { - val buffer = new StringBuffer(width) - var i = 0 - while (i < width) - buffer.append(' ') - setIndentString(buffer.toString()) - } + def setIndentWidth(width: Int): CodeWriter = + setIndentString(List.make(width, ' ').mkString) def getIndentString = step; |