1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +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