| 2580 | |
| 2581 | template<class Compare> |
| 2582 | static const ValueFlow::Value* getCompareValue(const std::list<ValueFlow::Value>& values, |
| 2583 | bool condition, |
| 2584 | MathLib::bigint path, |
| 2585 | Compare compare) |
| 2586 | { |
| 2587 | const ValueFlow::Value* ret = nullptr; |
| 2588 | for (const ValueFlow::Value& value : values) { |
| 2589 | if (!value.isIntValue()) |
| 2590 | continue; |
| 2591 | if (value.isImpossible()) |
| 2592 | continue; |
| 2593 | if (path > -0 && value.path != 0 && value.path != path) |
| 2594 | continue; |
| 2595 | if ((!ret || compare(value.intvalue, ret->intvalue)) && ((value.condition != nullptr) == condition)) |
| 2596 | ret = &value; |
| 2597 | } |
| 2598 | return ret; |
| 2599 | } |
| 2600 | |
| 2601 | const ValueFlow::Value* Token::getMaxValue(bool condition, MathLib::bigint path) const |
| 2602 | { |
no test coverage detected