This is an automated email from the ASF dual-hosted git repository.
lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 3a92f6a0bf Fix a regression in 6353e786
3a92f6a0bf is described below
commit 3a92f6a0bf3c73451a5fcc0b1d6de6fe5a6bb5b2
Author: lihan <[email protected]>
AuthorDate: Thu Aug 10 15:48:56 2023 +0800
Fix a regression in 6353e786
---
java/org/apache/catalina/mapper/Mapper.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/java/org/apache/catalina/mapper/Mapper.java
b/java/org/apache/catalina/mapper/Mapper.java
index b1cfa8033b..b8708b9c45 100644
--- a/java/org/apache/catalina/mapper/Mapper.java
+++ b/java/org/apache/catalina/mapper/Mapper.java
@@ -1332,7 +1332,8 @@ public final class Mapper {
private static int compare(CharChunk name, int start, int end, String
compareTo) {
int result = 0;
char[] c = name.getBuffer();
- int len = compareTo.length();
+ int compareLen = compareTo.length();
+ int len = compareLen;
if ((end - start) < len) {
len = end - start;
}
@@ -1346,9 +1347,9 @@ public final class Mapper {
}
}
if (result == 0) {
- if (len > (end - start)) {
+ if (compareLen > (end - start)) {
result = -1;
- } else if (len < (end - start)) {
+ } else if (compareLen < (end - start)) {
result = 1;
}
}
@@ -1363,7 +1364,8 @@ public final class Mapper {
private static int compareIgnoreCase(CharChunk name, int start, int end,
String compareTo) {
int result = 0;
char[] c = name.getBuffer();
- int len = compareTo.length();
+ int compareLen = compareTo.length();
+ int len = compareLen;
if ((end - start) < len) {
len = end - start;
}
@@ -1377,9 +1379,9 @@ public final class Mapper {
}
}
if (result == 0) {
- if (len > (end - start)) {
+ if (compareLen > (end - start)) {
result = -1;
- } else if (len < (end - start)) {
+ } else if (compareLen < (end - start)) {
result = 1;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]