Commit f67ca023 authored by ericu@google.com's avatar ericu@google.com

Reorder declaration vs. usage, build padToWidth on top of stringOfLength.

All changes in perf_test.js are reorders--no actual code change.

BUG=137764
TEST=self

Review URL: https://chromiumcodereview.appspot.com/10828119

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149477 0039d316-1c4b-4281-b951-d872f2087c98
parent f50d3466
......@@ -193,12 +193,20 @@ function getDisplayName(args) {
function padToWidth(s, width) {
s = String(s);
assert(s.length <= width);
while (s.length < width) {
s = "0" + s;
if (s.length < width) {
s = stringOfLength(width - s.length, '0') + s;
}
return s;
}
function stringOfLength(n, c) {
if (c == null)
c = 'X';
assert(n > 0);
assert(n == Math.floor(n));
return new Array(n + 1).join(c);
}
function getSimpleKey(i) {
return "key " + padToWidth(i, 10);
}
......@@ -334,10 +342,3 @@ function getValuesFromCursor(
}
request.onerror = onError;
}
function stringOfLength(n) {
assert(n > 0);
assert(n == Math.floor(n));
return new Array(n + 1).join('0');
}
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment