Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
[Perf] Remove another getRange()
Browse files Browse the repository at this point in the history
  • Loading branch information
mdevils committed Apr 12, 2016
1 parent b4bf41a commit 479d071
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/disallow-space-after-object-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ module.exports.prototype = {
var alignedOnColon = 0;
tokens.forEach(function(key) {
var colon = file.getNextToken(key);
var spaces = Math.abs(colon.getRange()[0] - key.getRange()[1]);
var spaces = file.getDistanceBetween(key, colon);
if (spaces === 0) {
withoutSpace++;
} else if (spaces === maxKeyEndPos - key.getLoc().end.column) {
Expand Down

0 comments on commit 479d071

Please sign in to comment.