MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / evalCond

Method evalCond

lib/reverseanalyzer.cpp:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 const Settings& settings;
47
48 std::pair<bool, bool> evalCond(const Token* tok) const {
49 std::vector<MathLib::bigint> result = analyzer->evaluate(tok);
50 // TODO: We should convert to bool
51 const bool checkThen = std::any_of(result.cbegin(), result.cend(), [](MathLib::bigint x) {
52 return x == 1;
53 });
54 const bool checkElse = std::any_of(result.cbegin(), result.cend(), [](MathLib::bigint x) {
55 return x == 0;
56 });
57 return std::make_pair(checkThen, checkElse);
58 }
59
60 bool update(Token* tok) {
61 Analyzer::Action action = analyzer->analyze(tok, Analyzer::Direction::Reverse);

Callers

nothing calls this directly

Calls 1

evaluateMethod · 0.80

Tested by

no test coverage detected