diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-10 15:08:38 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-10 15:08:38 +0000 |
commit | 8821b0f220c62faf1e8c9e21eac3563acb98964e (patch) | |
tree | d79e136ef1e65ffb6fc9bec3d53e486226e54bda /src/compiler | |
parent | d08296f0639e9d97281dc0cdfe88dcf207941995 (diff) | |
download | scala-8821b0f220c62faf1e8c9e21eac3563acb98964e.tar.gz scala-8821b0f220c62faf1e8c9e21eac3563acb98964e.tar.bz2 scala-8821b0f220c62faf1e8c9e21eac3563acb98964e.zip |
Avoiding String.isEmpty.
It has a full quiver of ways to break us, no review.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Parsers.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Scanners.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 787dde541d..104f53eb4d 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -1130,7 +1130,7 @@ self => private def stringOp(t: Tree, op: TermName) = { val str = in.strVal in.nextToken() - if (str.isEmpty) t + if (str.length == 0) t else atPos(t.pos.startOrPoint) { Apply(Select(t, op), List(Literal(Constant(str)))) } diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 89384b8801..c642af5dd7 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -599,7 +599,7 @@ trait Scanners extends ScannersCommon { getLitChars('}', '"', ' ', '\t') if (ch == '}') { setStrVal() - if (!strVal.isEmpty) strVal = "%" + strVal + if (strVal.length > 0) strVal = "%" + strVal token = STRINGFMT } else { syntaxError("unclosed format string") |