Skip to content

Commit 1858331

Browse files
committed
Limit the number of iterations in scaleLinear.nice
1 parent 694ed8f commit 1858331

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/linear.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export function linearish(scale) {
2626
let stop = d[i1];
2727
let prestep;
2828
let step;
29+
let maxIter = 10;
2930

3031
if (stop < start) {
3132
step = start, start = stop, stop = step;
3233
step = i0, i0 = i1, i1 = step;
3334
}
3435

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

0 commit comments

Comments
 (0)