From 9d84e89d27c396203e84f6ae685863210ebc1968 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 14 Sep 2012 10:54:23 -0700 Subject: Added constant empty array to the companion objects. Because there are lots of times when you just need an array and shouldn't have to allocate one every time or pick a random spot to cache yet another empty array. --- test/files/run/empty-array.check | 3 +++ test/files/run/empty-array.scala | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/files/run/empty-array.check create mode 100644 test/files/run/empty-array.scala (limited to 'test') diff --git a/test/files/run/empty-array.check b/test/files/run/empty-array.check new file mode 100644 index 0000000000..bb0b1cf658 --- /dev/null +++ b/test/files/run/empty-array.check @@ -0,0 +1,3 @@ +0 +0 +0 diff --git a/test/files/run/empty-array.scala b/test/files/run/empty-array.scala new file mode 100644 index 0000000000..e56c86df5c --- /dev/null +++ b/test/files/run/empty-array.scala @@ -0,0 +1,8 @@ +object Test { + def main(args: Array[String]): Unit = { + println(Byte.emptyArray.length) + println(Double.emptyArray.length) + println(Boolean.emptyArray.length) + // okay okay okay + } +} -- cgit v1.2.3