MCPcopy Create free account
hub / github.com/WheretIB/nullc / apply_predicate

Method apply_predicate

external/pugixml/pugixml.cpp:6950–6974  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6948 }
6949
6950 void apply_predicate(xpath_node_set_raw& ns, size_t first, xpath_ast_node* expr, const xpath_stack& stack)
6951 {
6952 assert(ns.size() >= first);
6953
6954 size_t i = 1;
6955 size_t size = ns.size() - first;
6956
6957 xpath_node* last = ns.begin() + first;
6958
6959 // remove_if... or well, sort of
6960 for (xpath_node* it = last; it != ns.end(); ++it, ++i)
6961 {
6962 xpath_context c(*it, i, size);
6963
6964 if (expr->rettype() == xpath_type_number)
6965 {
6966 if (expr->eval_number(c, stack) == i)
6967 *last++ = *it;
6968 }
6969 else if (expr->eval_boolean(c, stack))
6970 *last++ = *it;
6971 }
6972
6973 ns.truncate(last);
6974 }
6975
6976 void apply_predicates(xpath_node_set_raw& ns, size_t first, const xpath_stack& stack)
6977 {

Callers

nothing calls this directly

Calls 8

assertFunction · 0.85
rettypeMethod · 0.80
eval_numberMethod · 0.80
eval_booleanMethod · 0.80
truncateMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected