Skip to content
Permalink
Browse files

8242186: Reduce allocations in URLStreamHandler.parseURL for some cases

Reviewed-by: redestad, chegar
  • Loading branch information
dreis2211 authored and cl4es committed Apr 6, 2020
1 parent 722a18d commit e9adf7bbe1dfbd048207989133aed0090779322f
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/java.base/share/classes/java/net/URLStreamHandler.java
@@ -266,8 +266,8 @@ protected void parseURL(URL u, String spec, int start, int limit) {
spec.substring(start, limit);

} else {
String separator = (authority != null) ? "/" : "";
path = separator + spec.substring(start, limit);
path = spec.substring(start, limit);
path = (authority != null) ? "/" + path : path;
}
} else if (queryOnly && path != null) {
int ind = path.lastIndexOf('/');

0 comments on commit e9adf7b

Please sign in to comment.