optimization to avoid complete line scanning searching for tabs if we are really interested for [start, start + columnNumber] range

This commit is contained in:
Maxim.Mossienko
2013-04-22 18:38:37 +02:00
parent c658a5b09e
commit b9265da381
@@ -301,7 +301,8 @@ public class EditorUtil {
boolean useOptimization = true;
boolean hasNonTabs = false;
boolean hasTabs = false;
for (int i = start; i < end; i++) {
int scanEndOffset = Math.min(end, start + columnNumber + 1);
for (int i = start; i < scanEndOffset; i++) {
char c = text.charAt(i);
if (debugBuffer != null) {
debugBuffer.append(String.format("Found symbol '%c' at the offset %d%n", c, i));