1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
systemd/coccinelle/cond-omit-middle.cocci
Frantisek Sumsal 64254629f7 coccinelle: add a transformation for GNU conditionals
i.e. x ? x : y => x ?: y
2023-03-18 14:23:11 +01:00

8 lines
170 B
Plaintext

/* 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