From 64254629f7e062a39156ee95428d46f2a1e82e06 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Sat, 18 Mar 2023 13:56:38 +0100 Subject: coccinelle: add a transformation for GNU conditionals i.e. x ? x : y => x ?: y --- coccinelle/cond-omit-middle.cocci | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 coccinelle/cond-omit-middle.cocci (limited to 'coccinelle') 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 -- cgit v1.2.1