Skip to content

Commit

Permalink
small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Nov 7, 2019
1 parent 3c73022 commit 1e3ee5f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/source-code/source-code.js
Expand Up @@ -437,8 +437,7 @@ class SourceCode extends TokenStore {
}

const nodesAreReversed = second.range[1] <= first.range[0];
const startingNodeOrToken = nodesAreReversed ? second : first;
const endingNodeOrToken = nodesAreReversed ? first : second;
const [startingNodeOrToken, endingNodeOrToken] = nodesAreReversed ? [second, first] : [first, second];
const firstToken = this.getLastToken(startingNodeOrToken) || startingNodeOrToken;
const finalToken = this.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
let currentToken = firstToken;
Expand Down

0 comments on commit 1e3ee5f

Please sign in to comment.