RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v7]
Claes Redestad
redestad at openjdk.org
Thu Feb 9 13:08:43 UTC 2023
On Thu, 9 Feb 2023 11:46:42 GMT, Eirik Bjorsnos <duke at openjdk.org> wrote:
> > In addition to - or instead of - an `equals` shortcut then if coders are the same we could use `ArraysSupport.mismatch` which should get similar speed and help more generally.
>
> ..and if String had (an optimized) mismatch method, then I bet all or most of the comparison methods (equals, compareTo, endsWith, startsWith, regionMatches) could delegate to that :-)
A private mismatch method might make sense. A public method would require making a stronger case, I think, e.g. showing use cases a mismatcher would solve (elegantly, performantly) that can't be expressed with existing methods.
-------------
PR: https://git.openjdk.org/jdk/pull/12290
More information about the security-dev
mailing list