mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 01:35:35 +00:00
Backed out changeset 5544a84d59a4 (bug 1350770) for bustage
This commit is contained in:
parent
4b10120624
commit
acc4241b37
@ -19,7 +19,6 @@ nsGenConList::Clear()
|
|||||||
delete node;
|
delete node;
|
||||||
}
|
}
|
||||||
mSize = 0;
|
mSize = 0;
|
||||||
mLastInserted = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
@ -42,9 +41,6 @@ nsGenConList::DestroyNodesFor(nsIFrame* aFrame)
|
|||||||
node = nextNode;
|
node = nextNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modification of the list invalidates the cached pointer.
|
|
||||||
mLastInserted = nullptr;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,11 +108,6 @@ nsGenConList::Insert(nsGenConNode* aNode)
|
|||||||
// Check for append.
|
// Check for append.
|
||||||
if (mList.isEmpty() || NodeAfter(aNode, mList.getLast())) {
|
if (mList.isEmpty() || NodeAfter(aNode, mList.getLast())) {
|
||||||
mList.insertBack(aNode);
|
mList.insertBack(aNode);
|
||||||
} else if (mLastInserted && mLastInserted != mList.getLast() &&
|
|
||||||
NodeAfter(aNode, mLastInserted) &&
|
|
||||||
NodeAfter(Next(mLastInserted), aNode)) {
|
|
||||||
// Fast path for inserting many consecutive nodes in one place
|
|
||||||
mLastInserted->setNext(aNode);
|
|
||||||
} else {
|
} else {
|
||||||
// Binary search.
|
// Binary search.
|
||||||
|
|
||||||
@ -151,8 +142,6 @@ nsGenConList::Insert(nsGenConNode* aNode)
|
|||||||
}
|
}
|
||||||
++mSize;
|
++mSize;
|
||||||
|
|
||||||
mLastInserted = aNode;
|
|
||||||
|
|
||||||
// Set the mapping only if it is the first node of the frame.
|
// Set the mapping only if it is the first node of the frame.
|
||||||
// The DEBUG blocks below are for ensuring the invariant required by
|
// The DEBUG blocks below are for ensuring the invariant required by
|
||||||
// nsGenConList::DestroyNodesFor. See comment there.
|
// nsGenConList::DestroyNodesFor. See comment there.
|
||||||
|
@ -86,7 +86,7 @@ protected:
|
|||||||
uint32_t mSize;
|
uint32_t mSize;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
nsGenConList() : mLastInserted(nullptr), mSize(0) {}
|
nsGenConList() : mSize(0) {}
|
||||||
~nsGenConList() { Clear(); }
|
~nsGenConList() { Clear(); }
|
||||||
void Clear();
|
void Clear();
|
||||||
static nsGenConNode* Next(nsGenConNode* aNode) {
|
static nsGenConNode* Next(nsGenConNode* aNode) {
|
||||||
@ -127,10 +127,6 @@ private:
|
|||||||
|
|
||||||
// Map from frame to the first nsGenConNode of it in the list.
|
// Map from frame to the first nsGenConNode of it in the list.
|
||||||
nsDataHashtable<nsPtrHashKey<nsIFrame>, nsGenConNode*> mNodes;
|
nsDataHashtable<nsPtrHashKey<nsIFrame>, nsGenConNode*> mNodes;
|
||||||
|
|
||||||
// A weak pointer to the node most recently inserted, used to avoid repeated
|
|
||||||
// list traversals in Insert().
|
|
||||||
nsGenConNode* mLastInserted;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* nsGenConList_h___ */
|
#endif /* nsGenConList_h___ */
|
||||||
|
Loading…
Reference in New Issue
Block a user