Skip to content

Commit 037063c

Browse files
committed
Save a whopping 12 bytes!
1 parent 9592f9b commit 037063c

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

d3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,13 +5906,13 @@
59065906
};
59075907
}
59085908
function d3_uninterpolateNumber(a, b) {
5909-
if ((b -= a = +a) === 0) b = Infinity;
5909+
b = (b -= a = +a) || 1 / b;
59105910
return function(x) {
59115911
return (x - a) / b;
59125912
};
59135913
}
59145914
function d3_uninterpolateClamp(a, b) {
5915-
if ((b -= a = +a) === 0) b = Infinity;
5915+
b = (b -= a = +a) || 1 / b;
59165916
return function(x) {
59175917
return Math.max(0, Math.min(1, (x - a) / b));
59185918
};

0 commit comments

Comments
 (0)