Skip to content

Commit

Permalink
Enable using String::equals fast-path intrinsics for exact matches (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
franz1981 authored Dec 1, 2023
1 parent 79ab46f commit d3858d7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions vertx-web/src/main/java/io/vertx/ext/web/impl/RouteState.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,16 +1251,15 @@ private static boolean pathMatchesExact(String base, String other, boolean signi
if (other.charAt(len -1) == '/') {
// final slash is not significant, ignore it
len--;
if (base.length() != len) {
return false;
}
// content must match
return other.regionMatches(0, base, 0, len);
}
}

// lengths are not the same (fail)
if (base.length() != len) {
return false;
}

// content must match
return other.regionMatches(0, base, 0, len);
return other.equals(base);
}

private void addPathParam(RoutingContext context, String name, String value) {
Expand Down

0 comments on commit d3858d7

Please sign in to comment.