On Thu, 9 Feb 2023 11:46:42 GMT, Eirik Bjorsnos <d...@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