On Fri, 3 Sep 2021 14:04:27 GMT, Roger Riggs <rri...@openjdk.org> wrote:
> Redundant null checks get collapsed by HotSpot, so not a performance > improvement. Hi Roger, indeed, no improvement observed. How did you know it beforehand? I was pretty sure we are going to win a couple of ns on this wide-used method. P.S. This double-check of null seems to be a left-over from https://github.com/openjdk/jdk/pull/2102. Previously there was only one NPE-throwing check there, but after `String.encode(Charset, byte, byte[])` was introduced we have two of them. ------------- PR: https://git.openjdk.java.net/jdk/pull/5361