diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-16 20:44:56 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-16 20:53:59 -0700 |
commit | d918144f16111358a61d6f5f847227946bcc17a9 (patch) | |
tree | 55dd3ae2790e5ed453575205f83a700b6732dcd4 /test | |
parent | 5cf6a750eac94d159fe4c67b75e24dde13495e71 (diff) | |
download | scala-d918144f16111358a61d6f5f847227946bcc17a9.tar.gz scala-d918144f16111358a61d6f5f847227946bcc17a9.tar.bz2 scala-d918144f16111358a61d6f5f847227946bcc17a9.zip |
Moved constant empty arrays into Array companion.
This reminds me of at least one reason I didn't put them
here before: I don't feel like I can return these from calls
to Array.empty, because there's no way of knowing whether
anyone has been relying upon this property:
scala> Array.empty[Byte] eq Array.empty[Byte]
res0: Boolean = false
Since that is exactly the property I need to alter.
The test above is true in all the "real" collections,
which is all the more reason to be concerned that someone
might be using empty arrays as not-equivalent sentinels.
I can still move them here, but it'd be a lot better if
array creation could use them - not only def empty but
def apply[T: ClassTag](xs: T*): Array[T]
which probably creates millions of empty arrays where
one would do in almost every case.
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions