remove unnecessary comparison with second match

This commit is contained in:
nightwing 2013-03-18 11:06:42 +04:00
commit cc7c023e7a

View file

@ -77,7 +77,6 @@ exports.$detectIndentation = function(lines, fallback) {
changesTotal += changes[i];
var first = {score: 0, length: 0};
var second = {score: 0, length: 0};
var spaceIndents = 0;
for (var i = 1; i < 12; i++) {
if (i == 1) {
@ -90,15 +89,11 @@ exports.$detectIndentation = function(lines, fallback) {
score += changes[i] / changesTotal;
}
if (score > first.score) {
second = first;
if (score > first.score)
first = {score: score, length: i};
} else if (score > second.score) {
second = {score: score, length: i};
}
}
if (second.score < 0.9 * first.score && first.score > 1.4)
if (first.score && first.score > 1.4)
var tabLength = first.length;
if (tabIndents > spaceIndents + 1)