summaryrefslogtreecommitdiff
path: root/coccinelle/no-if-assignments.cocci
blob: 9f63e903376e06fd791f8bc964d9f25eb336a109 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@@
expression p, q;
identifier r;
statement s;
@@
- if ((r = q) < p)
- s
+ r = q;
+ if (r < p)
+ s
@@
expression p, q;
identifier r;
statement s;
@@
- if ((r = q) >= p)
- s
+ r = q;
+ if (r >= p)
+ s