Commit fb68c8cb authored by yurys@chromium.org's avatar yurys@chromium.org

Remove HeapSnapshotItemIterator.rewind

We don't actually need to rewind iterators. The iterators should be one-pass only and rewind just complicates the code.

BUG=None

Review URL: https://codereview.chromium.org/206393004

git-svn-id: svn://svn.chromium.org/blink/trunk@169654 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent da6a56e7
......@@ -49,7 +49,7 @@ function test()
var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex);
var iterator = new WebInspector.HeapSnapshotNodeIterator(nodeRoot);
var names = [];
for (iterator.rewind(); iterator.hasNext(); iterator.next())
for (; iterator.hasNext(); iterator.next())
names.push(iterator.item().name());
InspectorTest.assertEquals(",A,B,C,D,E", names.join(","), "node iterator");
},
......@@ -71,8 +71,7 @@ function test()
var snapshot = InspectorTest.createJSHeapSnapshotMockObject();
var nodeRoot = snapshot.createNode(snapshot._rootNodeIndex);
var names = [];
var iterator = nodeRoot.edges();
for (iterator.rewind(); iterator.hasNext(); iterator.next())
for (var iterator = nodeRoot.edges(); iterator.hasNext(); iterator.next())
names.push(iterator.item().name());
InspectorTest.assertEquals("a,b", names.join(","), "edge iterator");
var nodeE = snapshot.createNode(15);
......
......@@ -137,8 +137,6 @@ WebInspector.HeapSnapshotEdge.prototype = {
WebInspector.HeapSnapshotItemIterator = function() { }
WebInspector.HeapSnapshotItemIterator.prototype = {
rewind: function() { },
/**
* @return {boolean}
*/
......@@ -175,11 +173,6 @@ WebInspector.HeapSnapshotEdgeIterator = function(edge)
}
WebInspector.HeapSnapshotEdgeIterator.prototype = {
rewind: function()
{
this.edge.edgeIndex = 0;
},
/**
* @return {boolean}
*/
......@@ -374,11 +367,6 @@ WebInspector.HeapSnapshotRetainerEdgeIterator = function(retainer)
}
WebInspector.HeapSnapshotRetainerEdgeIterator.prototype = {
rewind: function()
{
this.retainer.setRetainerIndex(0);
},
/**
* @return {boolean}
*/
......@@ -650,11 +638,6 @@ WebInspector.HeapSnapshotNodeIterator = function(node)
}
WebInspector.HeapSnapshotNodeIterator.prototype = {
rewind: function()
{
this.node.nodeIndex = this.node._firstNodeIndex;
},
/**
* @return {boolean}
*/
......@@ -709,8 +692,6 @@ WebInspector.HeapSnapshotIndexRangeIterator = function(iterator, indexes)
}
WebInspector.HeapSnapshotIndexRangeIterator.prototype = {
rewind: function() { },
/**
* @return {boolean}
*/
......@@ -766,8 +747,6 @@ WebInspector.HeapSnapshotFilteredIterator = function(iterator, filter)
}
WebInspector.HeapSnapshotFilteredIterator.prototype = {
rewind: function() { },
/**
* @return {boolean}
*/
......
......@@ -141,7 +141,7 @@ WebInspector.JSHeapSnapshot.prototype = {
if (globalObjEdge.isShortcut())
propNames[globalObjEdge._nameOrIndex()] = true;
}
for (innerIter.rewind(); innerIter.hasNext(); innerIter.next()) {
for (var innerIter = node.edges(); innerIter.hasNext(); innerIter.next()) {
var globalObjEdge = innerIter.edge;
if (!globalObjEdge.isShortcut()
&& globalObjEdge.node().isHidden()
......
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