improve sql parser performance

This commit is contained in:
wenshao
2013-01-14 20:45:13 +08:00
parent cb45e49a0c
commit 7aa2038498
6 changed files with 71 additions and 21 deletions
@@ -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;
}
}