Hi, This is an unrelated issue, yet is there any reason for the inner loop of equals to be written in such a (confusing) way?
if (n == anotherString.value.length) { char v1[] = value; char v2[] = anotherString.value; int i = 0; while (n-- != 0) { if (v1[i] != v2[i]) return false; i++; } return true; } instead of just "for (int i=0;i<n;i++) if (v1[i]!=v2[i]) return false;" Stanimir On Tue, Oct 14, 2014 at 8:13 PM, Chris Hegarty <chris.hega...@oracle.com> wrote: > On 14 Oct 2014, at 17:33, Martin Buchholz <marti...@google.com> wrote: > > > Looks good to me! > > +1 'noreg-hard' > > -Chris. > > > On Tue, Oct 14, 2014 at 9:05 AM, Aleksey Shipilev < > > aleksey.shipi...@oracle.com> wrote: > > > >> Hi, > >> > >> Please review a trivial change in String.contentEquals: > >> https://bugs.openjdk.java.net/browse/JDK-8060485 > >> http://cr.openjdk.java.net/~shade/8060485/webrev.00/ > >> > >> It improves the performance drastically: > >> http://cr.openjdk.java.net/~shade/8060485/perf.txt > >> > >> ...not to mention it improves the code readability, and protects us from > >> rogue CharSequence-s. > >> > >> Testing: microbenchmarks, jdk/test/String* jtreg. > >> > >> Thanks, > >> -Aleksey. > >> > >> > >