summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-21 17:45:03 +0000
committerPaul Phillips <paulp@improving.org>2011-05-21 17:45:03 +0000
commit9cc4c5f9a30b11461d563d8009dfc9af462aac16 (patch)
treec2da7ae7401fc01c2129a5fb861691ffd634a65a
parente22d7f9915b23fa958f4cfccb9591b214a46c0da (diff)
downloadscala-9cc4c5f9a30b11461d563d8009dfc9af462aac16.tar.gz
scala-9cc4c5f9a30b11461d563d8009dfc9af462aac16.tar.bz2
scala-9cc4c5f9a30b11461d563d8009dfc9af462aac16.zip
Array[Byte] => Array[Char] => String => Array[C...
Array[Byte] => Array[Char] => String => Array[Char] => Name. That's not how Professor Optimize said to do it! No review.
-rw-r--r--src/compiler/scala/reflect/internal/Names.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/internal/Names.scala b/src/compiler/scala/reflect/internal/Names.scala
index 4c1f449430..2c5f2f9fcd 100644
--- a/src/compiler/scala/reflect/internal/Names.scala
+++ b/src/compiler/scala/reflect/internal/Names.scala
@@ -96,8 +96,10 @@ trait Names /*extends reflect.generic.Names*/ {
/** Create a term name from the UTF8 encoded bytes in bs[offset..offset+len-1].
*/
- def newTermName(bs: Array[Byte], offset: Int, len: Int): TermName =
- newTermName(Codec fromUTF8 bs.slice(offset, offset + len) mkString)
+ def newTermName(bs: Array[Byte], offset: Int, len: Int): TermName = {
+ val chars = Codec fromUTF8 bs.slice(offset, offset + len)
+ newTermName(chars, 0, chars.length)
+ }
/** Create a type name from the characters in cs[offset..offset+len-1].
*/