Commit d3440880 authored by Stephane Nicoll's avatar Stephane Nicoll

Polish "Avoid unnecessary pattern compilation in WebFluxTags"

See gh-24147
parent b22bb7ea
...@@ -131,13 +131,6 @@ public final class WebFluxTags { ...@@ -131,13 +131,6 @@ public final class WebFluxTags {
return URI_UNKNOWN; return URI_UNKNOWN;
} }
private static String removeTrailingSlash(String text) {
if (!StringUtils.hasLength(text)) {
return text;
}
return text.endsWith("/") ? text.substring(0, text.length() - 1) : text;
}
private static String getPathInfo(ServerWebExchange exchange) { private static String getPathInfo(ServerWebExchange exchange) {
String path = exchange.getRequest().getPath().value(); String path = exchange.getRequest().getPath().value();
String uri = StringUtils.hasText(path) ? path : "/"; String uri = StringUtils.hasText(path) ? path : "/";
...@@ -145,6 +138,13 @@ public final class WebFluxTags { ...@@ -145,6 +138,13 @@ public final class WebFluxTags {
return removeTrailingSlash(singleSlashes); return removeTrailingSlash(singleSlashes);
} }
private static String removeTrailingSlash(String text) {
if (!StringUtils.hasLength(text)) {
return text;
}
return text.endsWith("/") ? text.substring(0, text.length() - 1) : text;
}
/** /**
* Creates an {@code exception} tag based on the {@link Class#getSimpleName() simple * Creates an {@code exception} tag based on the {@link Class#getSimpleName() simple
* name} of the class of the given {@code exception}. * name} of the class of the given {@code exception}.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment