RFR: 8339290: Optimize ClassFile Utf8EntryImpl#writeTo [v14]
Chen Liang
liach at openjdk.org
Tue Sep 3 13:48:21 UTC 2024
On Tue, 3 Sep 2024 12:42:08 GMT, Claes Redestad <redestad at openjdk.org> wrote:
>> Shaojin Wen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update src/java.base/share/classes/java/lang/System.java
>>
>> Co-authored-by: Claes Redestad <claes.redestad at oracle.com>
>
> src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java line 397:
>
>> 395:
>> 396: /**
>> 397: * if string#coder() is Latin1 return the count of string#value() leading greater than zero, else return 0
>
> Can you move this next to `countPositives`?
>
> Suggestion:
>
> * Count the number of leading positive, non-zero bytes in the range.
>
>
> Technically this new routine is the "real" `countPositives` since, mathematically speaking, zero is neither positive nor negative. It's named like it is because I'm no mathematician, and now it might be better to rename away from that to disambiguate.. If you feel like it then please file an RFE to have `countPositives` renamed to `countNonNegatives`
We might rename these to `countAscii` and `countModifiedUtf8Compatible`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20772#discussion_r1742093845
More information about the core-libs-dev
mailing list