Skip to content

Commit

Permalink
Math.abs() is not faster
Browse files Browse the repository at this point in the history
  • Loading branch information
stevemao committed Jul 22, 2016
1 parent ff08b41 commit f045483
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function repeat0(len) {
// each time `ch` is "doubled", the `len` would need to be "doubled" too
// similar to finding a value in binary search tree, hence O(log(n))
if (len) ch += ch;
// `len` is 0, return zeros
// `len` is `0`, return `zeros`
else return zeros;
}
}
Expand Down Expand Up @@ -210,7 +210,6 @@ function expand(str) {
c = '';
} else {
// isNumericSequence is true
// todo: is Math.abs() faster?
c = String(i);
if (pad) {
var width = Math.max(n[0].length, n[1].length)
Expand Down

0 comments on commit f045483

Please sign in to comment.