Skip to content

Commit 8fa5b1a

Browse files
committed
Inline second argument of indexOfFirstPercentChar
1 parent 436d58d commit 8fa5b1a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/github/packageurl/PackageURL.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,8 @@ private static String toLowerCase(String s) {
589589
return new String(chars);
590590
}
591591

592-
private static int indexOfPercentChar(final byte[] bytes, final int start) {
593-
return IntStream.range(start, bytes.length)
592+
private static int indexOfFirstPercentChar(final byte[] bytes) {
593+
return IntStream.range(0, bytes.length)
594594
.filter(i -> isPercent(bytes[i]))
595595
.findFirst()
596596
.orElse(-1);
@@ -629,7 +629,7 @@ private static String percentDecode(final String source) {
629629
}
630630

631631
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
632-
int i = indexOfPercentChar(bytes, 0);
632+
int i = indexOfFirstPercentChar(bytes);
633633

634634
if (i == -1) {
635635
return source;

0 commit comments

Comments
 (0)