| 1295 | } |
| 1296 | |
| 1297 | static void pruneConditions(std::vector<const Token*>& conds, |
| 1298 | bool b, |
| 1299 | const std::unordered_map<nonneg int, ValueFlow::Value>& state) |
| 1300 | { |
| 1301 | conds.erase(std::remove_if(conds.begin(), |
| 1302 | conds.end(), |
| 1303 | [&](const Token* cond) { |
| 1304 | if (cond->exprId() == 0) |
| 1305 | return false; |
| 1306 | auto it = state.find(cond->exprId()); |
| 1307 | if (it == state.end()) |
| 1308 | return false; |
| 1309 | const ValueFlow::Value& v = it->second; |
| 1310 | return isTrueOrFalse(v, !b); |
| 1311 | }), |
| 1312 | conds.end()); |
| 1313 | } |
| 1314 | |
| 1315 | namespace { |
| 1316 | struct Executor { |
no test coverage detected