inefficient indexof when String has one length

Paul Sandoz paul.sandoz at oracle.com
Mon Apr 28 07:42:48 UTC 2014


On Apr 27, 2014, at 2:22 PM, Claes Redestad <claes.redestad at oracle.com> wrote:
> Possibly a few bytes in static class footprint, sure. Maybe this is something javac should optimize (javap on some trivial examples suggests this doesn't happen) rather than trying to root out all suboptimal cases, especially since there are bound to be a lot more code out there using similar patterns?
> 

While javac can and perhaps should be smarter in certain cases like this i am still supportive of this change in the JDK esp. so if it is something trivially detectable by IDEs; it's low-hanging fruit.

Paul.



More information about the core-libs-dev mailing list