Skip to content

Commit ca2c943

Browse files
committed
Optimize d3_geo_compose slightly.
1 parent a76c08c commit ca2c943

3 files changed

Lines changed: 9 additions & 18 deletions

File tree

d3.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6072,15 +6072,11 @@
60726072
}
60736073
}
60746074
function d3_geo_compose(a, b) {
6075-
if (a === d3_geo_equirectangular) return b;
6076-
if (b === d3_geo_equirectangular) return a;
6077-
function compose(λ, φ) {
6078-
var coordinates = a(λ, φ);
6079-
return b(coordinates[0], coordinates[1]);
6075+
function compose(x, y) {
6076+
return x = a(x, y), b(x[0], x[1]);
60806077
}
60816078
if (a.invert && b.invert) compose.invert = function(x, y) {
6082-
var coordinates = b.invert(x, y);
6083-
return a.invert(coordinates[0], coordinates[1]);
6079+
return x = b.invert(x, y), a.invert(x[0], x[1]);
60846080
};
60856081
return compose;
60866082
}

0 commit comments

Comments
 (0)