Skip to content
Snippets Groups Projects
Commit 6b659db2 authored by Marie Janssen's avatar Marie Janssen
Browse files

readability fix: No assigns in if conditionals

Coccinelle-assisted:
@@
variable i;
expression E;
statement S1, S2;
@@

+ i = E;
  if (
(
-   (i = E)
+   i
    != ...
|
-   (i = E)
+   i
    == ...
|
-   (i = E)
+   i
    < ...
|
-   (i = E)
+   i
    > ...
|
-   (i = E)
+   i
    <= ...
|
-   (i = E)
+   i
    >= ...
|
-   (i = E)
+   i
)
    ) S1 else S2

for file in $(find . -name "*.cc"); do
  spatch --sp no-if-assigns.cocci --in-place $file
done

clang-format --style=file -i bta/**/*.cc

Test: mma -j37 and basic sanity testing on angler, sailfish

Change-Id: I41a2964afac347c24e13869b6c172e321e646091
parent d4b16824
No related branches found
No related tags found
No related merge requests found
Showing
with 148 additions and 113 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment