ValueFlow: Fixed isEqual
This commit is contained in:
parent
98c7c0af96
commit
707f1f2fbe
|
@ -345,7 +345,12 @@ static bool isComputableValue(const Token* parent, const ValueFlow::Value& value
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
static bool isEqual(T x, T y) {
|
static bool isEqual(T x, T y) {
|
||||||
T diff = (x > y) ? x - y : y - x;
|
return x == y;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
bool isEqual<double>(double x, double y) {
|
||||||
|
const double diff = (x > y) ? x - y : y - x;
|
||||||
return !((diff / 2) < diff);
|
return !((diff / 2) < diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue