Skip to content

Commit

Permalink
Reuse variable redhat-developer#204
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Pupier <[email protected]>
  • Loading branch information
apupier committed Jul 22, 2020
1 parent 78d9426 commit 5368bf9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/languageservice/services/yamlSchemaService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5368bf9

Please sign in to comment.