Skip to content

Commit

Permalink
Use a better equality check for deciding when to fit. Closes elastic#76
Browse files Browse the repository at this point in the history
  • Loading branch information
Rashid Khan committed Mar 10, 2016
1 parent f9d3078 commit f4f725d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/classes/timelion_function.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module.exports = class TimelionFunction {
seriesList.list = _.map(seriesList.list, function (series) {
var target = tlConfig.getTargetSeries();

// Don't fit if the last of the target and last of series are the same
if (_.last(series.data)[0] === _.last(target)[0]) return series;
// Don't fit if the series are already the same
if (_.isEqual(_.map(series.data, 0), _.map(target, 0))) return series;

var fit;
if (args.byName.fit) {
Expand All @@ -39,4 +39,4 @@ module.exports = class TimelionFunction {
});
}
}
};
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "timelion",
"version": "0.1.252",
"version": "0.1.253",
"dependencies": {
"body-parser": "^1.12.0",
"boom": "^2.8.0",
Expand Down

0 comments on commit f4f725d

Please sign in to comment.