Instead of cloning `me.scaleSizeInUnits` moments and probably throwing the vast majority away, only clone what we need.
me.ticks.push(me.firstTick.clone());
// For every unit in between the first and last moment, create a moment and add it to the ticks tick
- for (var i = 1; i <= me.scaleSizeInUnits; ++i) {
+ for (var i = me.unitScale; i <= me.scaleSizeInUnits; i += me.unitScale) {
var newTick = roundedStart.clone().add(i, me.tickUnit);
// Are we greater than the max time
break;
}
- if (i % me.unitScale === 0) {
- me.ticks.push(newTick);
- }
+ me.ticks.push(newTick);
}
// Always show the right tick