Skip to content

Commit

Permalink
Limit the number of iterations in scaleLinear.nice
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed May 20, 2020
1 parent 694ed8f commit 1858331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/linear.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export function linearish(scale) {
let stop = d[i1];
let prestep;
let step;
let maxIter = 10;

if (stop < start) {
step = start, start = stop, stop = step;
step = i0, i0 = i1, i1 = step;
}

// eslint-disable-next-line no-constant-condition
while (true) {
while (maxIter-- > 0) {
const step = tickIncrement(start, stop, count);
if (step === prestep) {
d[i0] = start
Expand Down

0 comments on commit 1858331

Please sign in to comment.