Skip to content

Commit

Permalink
Reuse variable #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 6672d2d commit a13c6e3
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 a13c6e3

Please sign in to comment.