From e11b08fa91c3f1a18c56c531d350cc2058939a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=BDia=C4=8Dik?= Date: Fri, 6 May 2016 10:09:19 +0200 Subject: [PATCH] Simplified check for indentation difference --- src/services/formatting/formatting.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/services/formatting/formatting.ts b/src/services/formatting/formatting.ts index 0388ba42b39..7931f1ea733 100644 --- a/src/services/formatting/formatting.ts +++ b/src/services/formatting/formatting.ts @@ -874,13 +874,7 @@ namespace ts.formatting { } function indentationIsDifferent(indentationString: string, startLinePosition: number): boolean { - let size = indentationString.length; - for (let i = 0; i < size; i++) { - if (indentationString.charCodeAt(i) !== sourceFile.text.charCodeAt(startLinePosition + i)) { - return true; - } - } - return false; + return indentationString !== sourceFile.text.substr(startLinePosition , indentationString.length); } function indentMultilineComment(commentRange: TextRange, indentation: number, firstLineIsIndented: boolean) {