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

Casper Norrbin cnorrbin at openjdk.org
Tue Nov 12 15:16:34 UTC 2024


On Tue, 12 Nov 2024 03:29:44 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> src/hotspot/share/classfile/stringTable.cpp line 153:
>> 
>>> 151: }
>>> 152: 
>>> 153: bool StringTable::wrapped_string_equals(oop java_string, StringWrapper wrapped_str, int _) {
>> 
>> Not sure what hotspot style rules are for unused parameters. Probably worth a comment as to why this unused parameter exists.
>
> A quick search of the Style Guide yields nothing. I'd prefer the existing name be kept, but if it really shouldn't be used, then an unnamed parameter will suffice, no need for giving it _ as a name

The `int` is only there to fit the requirements for `CompactHashtable`. It shouldn't be used as it does nothing. I have now made it an unnamed parameter instead with a comment explaining why its needed:

https://github.com/openjdk/jdk/blob/4a78433cd33530186b7638a6aefd0e73ec50a3d5/src/hotspot/share/classfile/stringTable.cpp?plain=1#L153-L154

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

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


More information about the hotspot-dev mailing list