Re: Request for Review : 6553074 : String{Buffer, Builder}.indexOf(Str, int) contains unnecessary allocation

2012-11-19 Thread Mike Duigou
On Nov 14 2012, at 13:24 , Jim Gish wrote: Mike, In String.java, with the new methods you're adding, should we make those String target parameters a CharSequence instead? A String param enables us to extract the internal char array for the search. We could not do so with a CharSequence

Re: Request for Review : 6553074 : String{Buffer, Builder}.indexOf(Str, int) contains unnecessary allocation

2012-11-19 Thread Ulf Zibis
Am 19.11.2012 23:09, schrieb Mike Duigou: On Nov 14 2012, at 13:24 , Jim Gish wrote: Mike, In String.java, with the new methods you're adding, should we make those String target parameters a CharSequence instead? A String param enables us to extract the internal char array for the search.

Request for Review : 6553074 : String{Buffer, Builder}.indexOf(Str, int) contains unnecessary allocation

2012-11-14 Thread Mike Duigou
Hello all; This patch causes the indexOf and lastIndexOf implementation in AbstractStringBuilder to directly compare the character arrays rather than making a copy of the substring before comparing. http://cr.openjdk.java.net/~mduigou/6553074/0/webrev/

Re: Request for Review : 6553074 : String{Buffer, Builder}.indexOf(Str, int) contains unnecessary allocation

2012-11-14 Thread Jim Gish
Mike, In String.java, with the new methods you're adding, should we make those String target parameters a CharSequence instead? Thanks, Jim On 11/14/2012 01:27 PM, Mike Duigou wrote: Hello all; This patch causes the indexOf and lastIndexOf implementation in AbstractStringBuilder to