Skip to content

Commit

Permalink
Minor simplification to number regex.
Browse files Browse the repository at this point in the history
If \d+\.?\d* doesn't match, then there are no digits before the "." so
no need to match \d* in the alternative pattern.
  • Loading branch information
jasondavies committed Apr 15, 2012
1 parent 3adff5a commit 4ffe6b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion d3.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ d3.interpolateObject = function(a, b) {
};
}

var d3_interpolate_number = /[-+]?(?:\d+\.?\d*|\d*\.?\d+)(?:[eE][-+]?\d+)?/g;
var d3_interpolate_number = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;

function d3_interpolateByName(n) {
return n == "transform"
Expand Down
Loading

0 comments on commit 4ffe6b4

Please sign in to comment.