remove unchecked for-in loop from detectIndentation
This commit is contained in:
parent
cc1cee2c23
commit
4b3d5fd52b
1 changed files with 2 additions and 3 deletions
|
|
@ -72,9 +72,7 @@ exports.$detectIndentation = function(lines, fallback) {
|
|||
return score;
|
||||
}
|
||||
|
||||
var changesTotal = 0;
|
||||
for (var i in changes)
|
||||
changesTotal += changes[i];
|
||||
var changesTotal = changes.reduce(function(a,b){return a+b}, 0);
|
||||
|
||||
var first = {score: 0, length: 0};
|
||||
var spaceIndents = 0;
|
||||
|
|
@ -112,6 +110,7 @@ exports.detectIndentation = function(session) {
|
|||
|
||||
if (indent.length)
|
||||
session.setTabSize(indent.length);
|
||||
return indent;
|
||||
};
|
||||
|
||||
exports.trimTrailingSpace = function(session) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue