[TRIVIAL] Fast-path for String.subsring(n,n)

Ivan Gerasimov ivan.gerasimov at oracle.com
Tue Feb 25 16:41:49 UTC 2020

Hi Sergei!

Wouldn't it make sense to incorporate this fast path into 

This way other callers of these methods will also benefit from it.

In particular, StringLatin1/StringUTF16.stripLeading(), 
StringLatin1/StringUTF16.stripTrailing() and maybe others could be 
slightly simplified.

With kind regards,


On 2/25/20 7:42 AM, Сергей Цыпанов wrote:
> Hello,
> current implementation of String.substring(int,int) has a fast-path for the case when beginIndex = 0 and endIndex = length.
> I think there should be similar fast-path for the case beginIndex = endIndex (asuming both are valid):
With kind regards,
Ivan Gerasimov

More information about the core-libs-dev mailing list