MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / apply_predicate_boolean

Method apply_predicate_boolean

lib/pugixml/src/pugixml.cpp:9718–9742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9716 }
9717
9718 static void apply_predicate_boolean(xpath_node_set_raw& ns, size_t first, xpath_ast_node* expr, const xpath_stack& stack, bool once)
9719 {
9720 assert(ns.size() >= first);
9721 assert(expr->rettype() != xpath_type_number);
9722
9723 size_t i = 1;
9724 size_t size = ns.size() - first;
9725
9726 xpath_node* last = ns.begin() + first;
9727
9728 // remove_if... or well, sort of
9729 for (xpath_node* it = last; it != ns.end(); ++it, ++i)
9730 {
9731 xpath_context c(*it, i, size);
9732
9733 if (expr->eval_boolean(c, stack))
9734 {
9735 *last++ = *it;
9736
9737 if (once) break;
9738 }
9739 }
9740
9741 ns.truncate(last);
9742 }
9743
9744 static void apply_predicate_number(xpath_node_set_raw& ns, size_t first, xpath_ast_node* expr, const xpath_stack& stack, bool once)
9745 {

Callers

nothing calls this directly

Calls 6

rettypeMethod · 0.80
eval_booleanMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
truncateMethod · 0.45

Tested by

no test coverage detected