From 5368bf9b8c00f3b55cf02bca94dcb9e5a6ead821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Wed, 22 Jul 2020 08:29:50 +0200 Subject: [PATCH] Reuse variable #204 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Pupier --- src/languageservice/services/yamlSchemaService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languageservice/services/yamlSchemaService.ts b/src/languageservice/services/yamlSchemaService.ts index edca6708c..cf39361e1 100644 --- a/src/languageservice/services/yamlSchemaService.ts +++ b/src/languageservice/services/yamlSchemaService.ts @@ -305,7 +305,7 @@ export class YAMLSchemaService extends JSONSchemaService { if (yamlLanguageServerModeline != undefined) { const schemaKey = '$schema='; const indexOfJsonSchemaParameter = yamlLanguageServerModeline.indexOf(schemaKey); - if (yamlLanguageServerModeline.indexOf(schemaKey) != -1) { + if (indexOfJsonSchemaParameter !== -1) { const startIndex = indexOfJsonSchemaParameter + schemaKey.length; const indexOfNextSpace = yamlLanguageServerModeline.indexOf(' ', startIndex); const endIndex = indexOfNextSpace !== -1 ? indexOfNextSpace : yamlLanguageServerModeline.length;