On Fri, 4 Feb 2022 23:02:21 GMT, Xue-Lei Andrew Fan <xue...@openjdk.org> wrote:

> Please review this trivial code clean up, for a little bit better performance.

There's a small compatibility risk with this change, e.g., 
`List.copyOf(...).contains(null)` will throw NPE while 
`Collections.unmodifiableList(...).contains(null)` won't.

If we accept that compatibility risk (which should probably be decided by CSR) 
it might also make sense to use `List.of()` for the empty case, which will 
reduce the number of List implementation classes returned from the API.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7356

Reply via email to