RFR: 8327156: Avoid copying in StringTable::intern(oop, TRAPS)

Johan Sjölen jsjolen at openjdk.org
Wed Oct 16 07:17:16 UTC 2024


On Tue, 15 Oct 2024 21:01:17 GMT, David Holmes <dholmes at openjdk.org> wrote:

>The len parameter is just the length of the array. We use it to iterate through the array. e.g.

Oops.

>But while technically accurate I don't think using num_unicode_points adds any value here - quite the opposite as it obscures that this is simply the length of the array.

Alright, I think it brings consistency with the fact that in the other methods we are actually passing in the number of unicode code points (like for the utf-8 case). In this case it happens to *also* be the length of the array. I think a comment in the code would help out a lot, regardless of the name chosen for the parameter.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21325#discussion_r1802487661


More information about the hotspot-dev mailing list