Comparing version 0.5.1 to 0.5.2
0.5.2 / 2015-02-19 | ||
================== | ||
* Refactor to improve performance on repeated character | ||
0.5.1 / 2015-02-19 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -184,3 +184,15 @@ 'use strict'; | ||
function repeat(times, character) { | ||
return new Array(times + 1).join(character); | ||
var result = ''; | ||
while (times > 0) { | ||
if (times % 2 === 1) { | ||
result += character; | ||
} | ||
character += character; | ||
times >>= 1; | ||
} | ||
return result; | ||
} | ||
@@ -187,0 +199,0 @@ |
{ | ||
"name": "mdast", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"description": "Speedy Markdown parser/stringifier for multipurpose analysis", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
110472
2903