RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

Xue-Lei Andrew Fan xuelei at openjdk.java.net
Mon Mar 28 20:11:42 UTC 2022


On Sun, 20 Mar 2022 12:45:34 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> In a few places String.indexOf/lastIndexOf methods are called with default parameter for index: `0` for `indexOf`, length() for `lastIndexOf`.
> I propose to cleanup such calls. It makes code a bit easier to read. In case of `indexOf` it even could be faster, as there is separate intrinsic for `indexOf` call without index argument.

Please add a noreg- label to the bug.  Otherwise, looks good to me.

-------------

Marked as reviewed by xuelei (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7877


More information about the serviceability-dev mailing list