[PATCH] java.util.Collections enhancement
Сергей Цыпанов
sergei.tsypanov at yandex.ru
Mon Sep 11 19:40:28 UTC 2017
Hi,
looking into the code of java.util.Collections I've found out that EmptyList#toArray() and EmptySet#toArray() both instantiate new instance of Object[] at each call. As far as Java array is immutable it's possible to cache empty Object array and return this cached instance.
Patch.txt is attached to the body of this mail.
Thanks,
- Sergei Tsypanov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-diff
Size: 1396 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/jdk9-dev/attachments/20170911/4299e462/patch.txt>
More information about the jdk9-dev
mailing list