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

Function isAdjacent

lib/token.cpp:2019–2026  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2017}
2018
2019static bool isAdjacent(const ValueFlow::Value& x, const ValueFlow::Value& y)
2020{
2021 if (x.bound != ValueFlow::Value::Bound::Point && x.bound == y.bound)
2022 return true;
2023 if (x.valueType == ValueFlow::Value::ValueType::FLOAT)
2024 return false;
2025 return std::abs(x.intvalue - y.intvalue) == 1;
2026}
2027
2028static bool removePointValue(std::list<ValueFlow::Value>& values, std::list<ValueFlow::Value>::iterator& x)
2029{

Callers 2

removeAdjacentValuesFunction · 0.85
mergeAdjacentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected