Permalink
Browse files

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.
  • Loading branch information...
1 parent e22d7f9 commit 9cc4c5f9a30b11461d563d8009dfc9af462aac16 @paulp paulp committed May 21, 2011
Showing with 4 additions and 2 deletions.
  1. +4 −2 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].
*/

0 comments on commit 9cc4c5f

Please sign in to comment.