Skip to content

Commit fb449fc

Browse files
committed
Don't use function.apply; it's slower.
1 parent 4d49ef7 commit fb449fc

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

d3.v2.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,12 +1957,14 @@
19571957
}
19581958
function d3_geo_compose(a, b) {
19591959
function compose(λ, φ) {
1960-
return b.apply(b, a(λ, φ));
1960+
var coordinates = a(λ, φ);
1961+
return b(coordinates[0], coordinates[1]);
19611962
}
19621963
if (a === d3_geo_equirectangular) return b;
19631964
if (b === d3_geo_equirectangular) return a;
19641965
if (a.invert && b.invert) compose.invert = function(x, y) {
1965-
return a.invert.apply(a, b.invert(x, y));
1966+
var coordinates = b.invert(x, y);
1967+
return a.invert(coordinates[0], coordinates[1]);
19661968
};
19671969
return compose;
19681970
}

0 commit comments

Comments
 (0)