diff options
| author | Julia Lawall <Julia.Lawall@inria.fr> | 2026-07-26 16:01:38 +0200 |
|---|---|---|
| committer | Julia Lawall <Julia.Lawall@inria.fr> | 2026-08-23 22:12:09 +0200 |
| commit | fd0a63f086b3f2f45c49b1378f6c2ac7a542db19 (patch) | |
| tree | f820acb14ab15937fded4ddd0a2e63337a55af55 /scripts | |
| parent | b32cf68d78a1f2a05797ec2a969b80a9472f45a7 (diff) | |
coccinelle: misc: minmax: drop unneeded parentheses
The outer parentheses don't matter when just matching an returning a line.
Eliminating them reduces the complexity of the pattern to match and
gives a small performance improvement in the non-patch cases.
Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/coccinelle/misc/minmax.cocci | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/coccinelle/misc/minmax.cocci b/scripts/coccinelle/misc/minmax.cocci index 93c074b9439f..905dd2292609 100644 --- a/scripts/coccinelle/misc/minmax.cocci +++ b/scripts/coccinelle/misc/minmax.cocci @@ -22,14 +22,14 @@ expression E1, E2, E3, E4; binary operator cmp = {>, >=}; @@ - (E1 cmp E2 ? E3 : E4) + E1 cmp E2 ? E3 : E4 @min_candidate@ expression E1, E2, E3, E4; binary operator cmp = {<, <=}; @@ - (E1 cmp E2 ? E3 : E4) + E1 cmp E2 ? E3 : E4 @rmax depends on !patch && max_candidate@ identifier func; @@ -41,7 +41,7 @@ position p; func(...) { <... -* ((x) cmp@p (y) ? (x) : (y)) +* (x) cmp@p (y) ? (x) : (y) ...> } @@ -89,7 +89,7 @@ position p != errcode.p; func(...) { <... -* ((x) cmp@p (y) ? (x) : (y)) +* (x) cmp@p (y) ? (x) : (y) ...> } |
