RFR: 8283800: Simplify String.indexOf/lastIndexOf calls

Andrey Turbanov aturbanov at openjdk.java.net
Mon Mar 28 19:25:05 UTC 2022


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.

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

Commit messages:
 - [PATCH] Simplify String.indexOf/lastIndexOf calls

Changes: https://git.openjdk.java.net/jdk/pull/7877/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7877&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283800
  Stats: 14 lines in 6 files changed: 0 ins; 0 del; 14 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7877.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7877/head:pull/7877

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



More information about the security-dev mailing list