Michal Privoznik 32b9d4390e coding-style: Allow some use of ternary operators
While we all understand that excessive use of ternary operator
may worsen code readability (e.g. nested, multi-line expression),
there are few cases where using it actually improves code
readability. For instance, when a function takes a long list of
arguments out of which one depends on a boolean expression, or
when formatting "yes"/"no" or "on"/"off" values based on a
boolean variable (although one can argue that the latter is a
subset of the former). Just consider alternatives to:

  virBufferAsprintf(buf, "<elem>%s</elem>\n", boolVar ? "yes" : "no");

In fact, this pattern occurs plenty in our code. Exempt it from
our "no ternary operators" rule.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-26 08:48:48 +02:00
..
2022-01-21 10:17:11 +01:00
2022-05-24 12:19:16 +02:00
2022-06-22 15:29:44 +02:00
2022-06-22 15:29:44 +02:00
2022-04-07 15:10:26 +02:00
2022-04-07 15:10:26 +02:00
2022-05-24 12:19:16 +02:00
2022-07-18 11:10:55 +02:00
2022-04-01 16:33:19 +02:00
2022-03-08 17:40:47 +01:00
2022-04-01 16:33:19 +02:00
2022-03-08 17:40:47 +01:00
2022-04-01 16:33:20 +02:00
2022-04-01 16:33:20 +02:00
2022-07-15 08:26:25 +02:00
2021-09-15 08:37:40 +02:00
2022-03-10 17:52:07 +01:00
2021-04-15 15:42:21 +02:00
2022-04-01 16:33:20 +02:00
2022-04-14 11:54:28 +02:00
2022-04-07 15:10:26 +02:00
2022-03-08 17:40:47 +01:00
2022-07-18 11:10:55 +02:00
2022-07-18 11:10:55 +02:00
2022-05-24 12:19:15 +02:00