RFR: 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length
Brian Burkhalter
bpb at openjdk.org
Thu Jul 21 15:54:29 UTC 2022
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)
-------------
Commit messages:
- 8290047: (fs) FileSystem.getPathMatcher needlessly checks syntaxAndInput.length
Changes: https://git.openjdk.org/jdk/pull/9595/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9595&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8290047
Stats: 5 lines in 4 files changed: 0 ins; 0 del; 5 mod
Patch: https://git.openjdk.org/jdk/pull/9595.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9595/head:pull/9595
PR: https://git.openjdk.org/jdk/pull/9595
More information about the core-libs-dev
mailing list