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

Ulf Zibis Ulf.Zibis at CoSoCo.de
Tue Nov 20 02:17:45 UTC 2012


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. We could not do so with a CharSequence and would have to create a substring somewhat like the old implementation did.

... or switch by a instanceof statement and then call ((String)sequence).value.

-Ulf




More information about the core-libs-dev mailing list