Index: tools/profileview.js |
diff --git a/tools/profileview.js b/tools/profileview.js |
index 53ef6d9e8ccd97bbd5e8bcc851dffb59f7790187..8cffccc7ca2d4edef5a66e7726918347f0f162e1 100644 |
--- a/tools/profileview.js |
+++ b/tools/profileview.js |
@@ -100,11 +100,12 @@ devtools.profiler.ProfileView.prototype.sort = function(sortFunc) { |
* @param {function(devtools.profiler.ProfileView.Node)} f Visitor function. |
*/ |
devtools.profiler.ProfileView.prototype.traverse = function(f) { |
- var nodesToTraverse = [this.head]; |
- while (nodesToTraverse.length > 0) { |
- var node = nodesToTraverse.shift(); |
+ var nodesToTraverse = new ConsArray(); |
+ nodesToTraverse.concat([this.head]); |
+ while (!nodesToTraverse.atEnd()) { |
+ var node = nodesToTraverse.next(); |
f(node); |
- nodesToTraverse = nodesToTraverse.concat(node.children); |
+ nodesToTraverse.concat(node.children); |
} |
}; |