File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
src/main/java/com/github/packageurl Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -589,20 +589,13 @@ 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 );
597597 }
598598
599- private static int indexOfUnsafeChar (final byte [] bytes , final int start ) {
600- return IntStream .range (start , bytes .length )
601- .filter (i -> shouldEncode (bytes [i ]))
602- .findFirst ()
603- .orElse (-1 );
604- }
605-
606599 private static byte percentDecode (final byte [] bytes , final int start ) {
607600 if (start + 2 >= bytes .length ) {
608601 throw new ValidationException ("Incomplete percent encoding at offset " + start + " with value '"
@@ -636,7 +629,7 @@ private static String percentDecode(final String source) {
636629 }
637630
638631 byte [] bytes = source .getBytes (StandardCharsets .UTF_8 );
639- int i = indexOfPercentChar (bytes , 0 );
632+ int i = indexOfFirstPercentChar (bytes );
640633
641634 if (i == -1 ) {
642635 return source ;
You can’t perform that action at this time.
0 commit comments