Use std::any_of in token.h (#2065)

[lib/token.h:964]: (style) Consider using std::any_of algorithm instead of a raw loop.
This commit is contained in:
Ken-Patrick 2019-08-07 08:02:07 +02:00 committed by Daniel Marjamäki
parent aaeec462e6
commit 9ec8886898
1 changed files with 3 additions and 5 deletions

View File

@ -960,11 +960,9 @@ public:
bool hasKnownIntValue() const {
if (!mImpl->mValues)
return false;
for (const ValueFlow::Value &value : *mImpl->mValues) {
if (value.isKnown() && value.isIntValue())
return true;
}
return false;
return std::any_of(mImpl->mValues->begin(), mImpl->mValues->end(), [](const ValueFlow::Value &value) {
return value.isKnown() && value.isIntValue();
});
}
bool hasKnownValue() const {