> We just need to copy the incoming list before filtering?
I tried that, but it's costly. I pass 500+ items lists as parameters! The only reason I'm switching to Jaxen is performance so I'm trying to keep it that way :) > Do you think we could radically alter evaluatePredicates to > look roughly like: > protected Iterator evaluatePredicates(Iterator contextNodes, ContextSupport >support) > The issue is that we're currently using the 'List contextNodeSet' parameter > as an IN_OUT parameter, and thus, we clobber its original contents. That's right. the new signature is protected List evaluatePredicates(...). It's only referenced in 2 places so it's easy to change. I've written what I think is a fast routine (faster than copying the list): - create a new empty - for each node in contextNodes that matches the first predicate, copy it to the new list - for all remaining predicates, for all nodes in the new list, if the predicate is false, set the node to null - clean up the new list by removing nulls (if there were any, there's a flag) This is only as slow as copying the list in the worst case, when the predicate is always true. Christian _______________________________________________ Jaxen-interest mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jaxen-interest