mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve sql parser performance
This commit is contained in:
@@ -91,4 +91,18 @@ public class StringUtils {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int lowerHashCode(String text) {
|
||||
// return text.toLowerCase().hashCode();
|
||||
int h = 0;
|
||||
for (int i = 0; i < text.length(); ++i) {
|
||||
char ch = text.charAt(i);
|
||||
if (ch >= 'A' && ch <= 'Z') {
|
||||
ch = (char) (ch + 32);
|
||||
}
|
||||
|
||||
h = 31 * h + ch;
|
||||
}
|
||||
return h;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user