Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed Feb 27, 2020
1 parent 6f6c06e commit bda81f1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/lib/mode_compiler.js
Expand Up @@ -57,12 +57,8 @@ export function compileLanguage(language) {
let match = this.matcherRe.exec(s);
if (!match) { return null; }

for(var i = 0; i<match.length; i++) {
if (match[i] != undefined && this.matchIndexes[i]) {
matchData = this.matchIndexes[i];
break;
}
}
let i = match.findIndex((el, i) => i>0 && el!=undefined);
matchData = this.matchIndexes[i];

return Object.assign(match, matchData);
}
Expand Down

0 comments on commit bda81f1

Please sign in to comment.