On Fri, 7 Nov 2025 22:14:51 GMT, Roger Riggs <[email protected]> wrote:
>> Xueming Shen has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> update to use value long for folding
>
> src/java.base/share/classes/jdk/internal/lang/CaseFolding.java.template line
> 169:
>
>> 167: private static final int HASH_NEXT = 2;
>> 168:
>> 169: private static int[][] hashKeys(int[] keys) {
>
> It may be worthwhile to round up the hash modulo to a prime number to avoid
> unfortunate hash collisions.
I did try several prime numbers. It doesn’t really help because the code points
in the table are mostly sequential within one continuous category range; if
there’s a hash collision, using a different prime will likely just move the
collision to the next code point.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27628#discussion_r2516418571