performance improvement: avoiding charAt range checks is worth the

cost of toCharArray
This commit is contained in:
Rick Giles 2002-12-25 23:27:31 +00:00
parent 4e0914c73b
commit 28753ca5fe
1 changed files with 2 additions and 1 deletions

View File

@ -101,8 +101,9 @@ public final class Utils
int aTabWidth)
{
int len = 0;
final char[] chars = aString.toCharArray();
for (int idx = 0; idx < aToIdx; idx++) {
if (aString.charAt(idx) == '\t') {
if (chars[idx] == '\t') {
len = (len / aTabWidth + 1) * aTabWidth;
}
else {