diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-03-18 13:56:38 +0100 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2023-03-18 14:23:11 +0100 |
commit | 64254629f7e062a39156ee95428d46f2a1e82e06 (patch) | |
tree | 89df195daa93888c025d67b0b09228a0ec4cb6f2 /coccinelle | |
parent | coccinelle: respect spacing from the semantic patch (diff) | |
download | systemd-64254629f7e062a39156ee95428d46f2a1e82e06.tar.xz systemd-64254629f7e062a39156ee95428d46f2a1e82e06.zip |
coccinelle: add a transformation for GNU conditionals
i.e. x ? x : y => x ?: y
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/cond-omit-middle.cocci | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/coccinelle/cond-omit-middle.cocci b/coccinelle/cond-omit-middle.cocci new file mode 100644 index 0000000000..f1587b8db3 --- /dev/null +++ b/coccinelle/cond-omit-middle.cocci @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* See: https://gcc.gnu.org/onlinedocs/gcc/Conditionals.html#Conditionals */ +@@ +expression e, x; +@@ +- e ? e : x ++ e ?: x |