[LANG-715] CharSetUtils.squeeze() speedup.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1144916 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4f287acdb
commit
48920b44f0
|
@ -73,10 +73,9 @@ public class CharSetUtils {
|
|||
char ch = ' ';
|
||||
for (int i = 0; i < sz; i++) {
|
||||
ch = chrs[i];
|
||||
if (chars.contains(ch)) {
|
||||
if ((ch == lastChar) && (i != 0)) {
|
||||
continue;
|
||||
}
|
||||
// Compare with contains() last for performance.
|
||||
if (ch == lastChar && i != 0 && chars.contains(ch)) {
|
||||
continue;
|
||||
}
|
||||
buffer.append(ch);
|
||||
lastChar = ch;
|
||||
|
|
Loading…
Reference in New Issue