Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludviggunne committed Oct 2, 2024
1 parent 3c2f6da commit 43be75e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3704,7 +3704,7 @@ bool isExhaustiveSwitch(const Token *startbrace)
if (!condition->valueType())
return true;

bool hasDefault{};
bool hasDefault = false;
const std::set<MathLib::bigint> switchValues = getSwitchValues(startbrace, hasDefault);

if (hasDefault)
Expand All @@ -3716,7 +3716,7 @@ bool isExhaustiveSwitch(const Token *startbrace)
if (condition->valueType()->isEnum()) {
const Scope *typeScope = condition->valueType()->typeScope;
const std::vector<Enumerator> &enumList = typeScope->enumeratorList;
const std::size_t usedValues = std::count_if(enumList.begin(), enumList.end(), [&](const Enumerator &e) {
const std::size_t usedValues = std::count_if(enumList.cbegin(), enumList.cend(), [&](const Enumerator &e) {
return e.value_known && switchValues.count(e.value);
});
return enumList.size() == usedValues;
Expand Down

0 comments on commit 43be75e

Please sign in to comment.