Skip to content

Commit

Permalink
refactor to reduce loc
Browse files Browse the repository at this point in the history
  • Loading branch information
CrokinoleMaster committed Jul 25, 2018
1 parent 762bb5e commit bc82b3b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/core/core.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,7 @@ module.exports = {
// sort by distance
Object.keys(byIndex).forEach(function(key) {
byIndex[key].sort(function(a, b) {
var centerA = a.getCenterPoint();
var centerB = b.getCenterPoint();
var distanceA = distanceMetric(position, centerA);
var distanceB = distanceMetric(position, centerB);
return distanceA - distanceB;
return distanceMetric(position, a.getCenterPoint()) - distanceMetric(position, b.getCenterPoint());
});
});

Expand Down

0 comments on commit bc82b3b

Please sign in to comment.