RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length
Naoto Sato
naoto at openjdk.org
Thu Jul 21 17:03:50 UTC 2022
On Thu, 21 Jul 2022 15:29:10 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> For a `String` “s”, `s.indexOf(int)` can never return a value `>= s.length()` so change the check
>
> int pos = syntaxAndInput.indexOf(':');
> if (pos <= 0 || pos == syntaxAndInput.length())
>
> to
>
> if (pos <= 0)
Looks good, Brian.
-------------
Marked as reviewed by naoto (Reviewer).
PR: https://git.openjdk.org/jdk/pull/9595
More information about the core-libs-dev
mailing list