diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-05-21 09:41:50 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-05-21 09:41:50 -0700 |
commit | 2b34363d03e0718c9e9f39982c723b806558c759 (patch) | |
tree | 0388b89e7794e3aa7c9ee2e923570cca56c7def9 /deps/v8/benchmarks/splay.js | |
parent | 9514a4d5476225e8c8310ce5acae2857033bcaaa (diff) | |
download | node-2b34363d03e0718c9e9f39982c723b806558c759.tar.gz |
Upgrade V8 to 2.2.11
Diffstat (limited to 'deps/v8/benchmarks/splay.js')
-rw-r--r-- | deps/v8/benchmarks/splay.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/deps/v8/benchmarks/splay.js b/deps/v8/benchmarks/splay.js index 53fc72793..d8c8f0427 100644 --- a/deps/v8/benchmarks/splay.js +++ b/deps/v8/benchmarks/splay.js @@ -46,16 +46,16 @@ var kSplayTreePayloadDepth = 5; var splayTree = null; -function GeneratePayloadTree(depth, key) { +function GeneratePayloadTree(depth, tag) { if (depth == 0) { return { array : [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], - string : 'String for key ' + key + ' in leaf node' + string : 'String for key ' + tag + ' in leaf node' }; } else { return { - left: GeneratePayloadTree(depth - 1, key), - right: GeneratePayloadTree(depth - 1, key) + left: GeneratePayloadTree(depth - 1, tag), + right: GeneratePayloadTree(depth - 1, tag) }; } } @@ -74,7 +74,8 @@ function InsertNewNode() { do { key = GenerateKey(); } while (splayTree.find(key) != null); - splayTree.insert(key, GeneratePayloadTree(kSplayTreePayloadDepth, key)); + var payload = GeneratePayloadTree(kSplayTreePayloadDepth, String(key)); + splayTree.insert(key, payload); return key; } |