Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
aarushjain29 committed Nov 19, 2024
1 parent 4a787b3 commit 4aaa2b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/simplify_algebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ auto fusable_split()

std::vector<instruction_ref> slices;

for (auto& output : ins->outputs())
for (const auto& output : ins->outputs())
{
if (output->name() == "slice")
{
Expand All @@ -432,7 +432,7 @@ auto fusable_split()
return false;

std::vector<instruction_ref> add_instructions;
for (auto& slice : slices)
for (const auto& slice : slices)
{
bool used_by_add = false;
for (auto& user : slice->outputs())

Check warning on line 438 in src/simplify_algebra.cpp

View workflow job for this annotation

GitHub Actions / tidy

'auto &user' can be declared as 'const auto &user' [readability-qualified-auto,-warnings-as-errors]
Expand All @@ -448,7 +448,7 @@ auto fusable_split()
}

bool any_add_followed_by_mul = false;
for (auto& add_ins : add_instructions)
for (const auto& add_ins : add_instructions)
{
for (auto& user : add_ins->outputs())

Check warning on line 453 in src/simplify_algebra.cpp

View workflow job for this annotation

GitHub Actions / tidy

'auto &user' can be declared as 'const auto &user' [readability-qualified-auto,-warnings-as-errors]
{
Expand All @@ -463,7 +463,6 @@ auto fusable_split()
if (!any_add_followed_by_mul)

Check warning on line 463 in src/simplify_algebra.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

style: Use 'not' instead of ! [UseNamedLogicOperator]
return false;

Check warning on line 464 in src/simplify_algebra.cpp

View workflow job for this annotation

GitHub Actions / tidy

redundant boolean literal in conditional return statement [readability-simplify-boolean-expr,-warnings-as-errors]

// All conditions met
return true;
});
}
Expand Down

0 comments on commit 4aaa2b9

Please sign in to comment.