diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-25 00:11:43 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-25 01:48:51 +0100 |
commit | bc997702ef50d8621d12f855ee17819d89c542f1 (patch) | |
tree | 9927d2fded0cf98d715ce455447ecb308da674b1 /src/reflect | |
parent | ee033022bc4db978796321b3fcf1d81377de2974 (diff) | |
download | scala-bc997702ef50d8621d12f855ee17819d89c542f1.tar.gz scala-bc997702ef50d8621d12f855ee17819d89c542f1.tar.bz2 scala-bc997702ef50d8621d12f855ee17819d89c542f1.zip |
Don't wrap an array just to get its length.
Use .length directly, avoiding the allocation of the WrappedArray.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/io/VirtualFile.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/io/VirtualFile.scala b/src/reflect/scala/reflect/io/VirtualFile.scala index b28ad9f340..8cc83b6a50 100644 --- a/src/reflect/scala/reflect/io/VirtualFile.scala +++ b/src/reflect/scala/reflect/io/VirtualFile.scala @@ -39,7 +39,7 @@ class VirtualFile(val name: String, override val path: String) extends AbstractF /** Returns null. */ def file: JFile = null - override def sizeOption: Option[Int] = Some(content.size) + override def sizeOption: Option[Int] = Some(content.length) def input : InputStream = new ByteArrayInputStream(content) |