Hi Sergei!

Wouldn't it make sense to incorporate this fast path into StringUTF16.newString/StringLatin1.newString?

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,

Ivan


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

Reply via email to