Speed up NodeSets by always keeping them in document order. Only sort when we get nodes in random order (such as for id()) or when merging NodeSets.

This removes the need for the sortByDocumentOrder function.

b=85893 r=Pike rs=jag


git-svn-id: svn://10.0.0.236/trunk@113703 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sicking%bigfoot.com
2002-02-05 14:22:34 +00:00
parent 7c8814ac5e
commit 6265d66757
24 changed files with 636 additions and 694 deletions

View File

@@ -56,16 +56,8 @@ void BasicNodeExpr::setNodeName(const String& name) {
* @return the result of the evaluation
**/
ExprResult* BasicNodeExpr::evaluate(Node* context, ContextState* cs) {
NodeSet* nodeSet = new NodeSet();
if (!context)
return nodeSet;
Node* node = context->getFirstChild();
while (node) {
if (matches(node, context, cs))
nodeSet->add(node);
node = node->getNextSibling();
}
return nodeSet;
NS_ASSERTION(0, "BasicNodeExpr::evaluate called");
return 0;
} //-- evaluate
/**