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-04-13 13:02:06 +02:00
2022-01-04 15:47:28 +01:00
2021-10-12 16:46:45 +02:00
2022-04-12 12:53:32 +02:00
2020-08-03 09:27:06 +02:00
2022-01-21 10:17:11 +01:00
2020-08-03 09:27:06 +02:00
2022-07-13 12:18:06 +01:00
2020-10-05 10:28:37 +01:00
2022-07-07 14:35:30 +02:00
2020-09-01 21:58:46 +02:00
2021-03-15 17:31:35 +01:00
2021-04-13 17:00:38 +02:00
2017-08-02 17:00:11 +01:00
2022-03-22 11:05:09 +01:00
2022-06-01 12:27:10 +02:00
2022-05-24 12:19:16 +02:00
2021-03-15 17:31:57 +01:00
2021-03-23 17:55:06 +01:00
2020-09-01 21:58:46 +02:00
2022-06-22 15:29:44 +02:00
2022-04-25 16:33:01 +02:00
2022-04-01 16:33:19 +02:00
2022-07-14 17:31:21 +02:00
2022-07-14 17:31:21 +02:00
2022-07-15 08:26:38 +02:00
2022-07-26 08:48:48 +02:00
2020-08-03 09:27:09 +02:00
2021-03-16 10:49:33 +01:00
2022-06-22 15:29:44 +02:00
2022-04-25 16:33:01 +02:00
2022-04-07 15:10:26 +02:00
2022-04-07 15:10:26 +02:00
2022-04-07 15:10:26 +02:00
2022-07-15 08:26:25 +02:00
2022-03-11 14:29:31 +01:00
2022-05-19 10:10:31 +02:00
2022-04-19 16:19:48 +02:00
2021-06-04 10:56:06 +01:00
2022-04-25 16:33:01 +02:00
2022-05-24 12:19:16 +02:00
2022-06-01 12:27:09 +02:00
2022-04-19 16:19:48 +02:00
2022-04-01 16:33:19 +02:00
2022-07-18 11:10:55 +02:00
2022-04-01 16:33:19 +02:00
2022-04-01 16:33:19 +02:00
2022-04-01 16:33:19 +02:00
2022-04-01 16:33:19 +02:00
2022-04-01 16:33:19 +02:00
2022-04-01 16:33:19 +02:00
2022-03-08 17:40:47 +01:00
2022-04-19 16:19:48 +02:00
2022-04-01 16:33:19 +02:00
2022-06-01 12:27:09 +02:00
2022-06-01 12:27:10 +02:00
2022-06-01 12:27:09 +02:00
2022-07-13 16:00:50 +02:00
2022-07-13 11:55:06 +02:00
2022-06-01 12:27:09 +02:00
2022-06-01 12:27:09 +02:00
2022-06-01 12:27:09 +02:00
2022-04-19 16:19:48 +02:00
2022-06-01 12:27:10 +02:00
2022-06-01 12:27:10 +02:00
2022-07-12 11:33:37 +02:00
2022-04-07 17:15:52 +02:00
2022-06-01 12:27:10 +02:00
2020-10-02 14:10:44 +02:00
2022-03-08 17:40:47 +01:00
2022-04-25 16:33:01 +02:00
2022-03-17 14:35:05 +01:00
2022-04-01 16:33:20 +02:00
2022-01-25 16:54:44 +01:00
2022-04-01 16:33:20 +02:00
2021-06-07 17:04:14 +01:00
2021-06-07 17:04:14 +01:00
2022-04-01 16:33:20 +02:00
2022-01-25 16:54:44 +01:00
2022-07-15 08:26:25 +02:00
2022-01-04 15:47:25 +01:00
2021-09-15 08:37:40 +02:00
2020-06-11 12:03:41 +02:00
2022-03-10 17:52:07 +01:00
2022-06-01 12:27:10 +02:00
2021-04-15 15:42:21 +02:00
2022-04-19 16:19:48 +02:00
2022-04-01 16:33:20 +02:00
2022-04-14 11:54:28 +02:00
2020-11-12 15:01:42 +01:00
2022-04-07 15:10:26 +02:00
2022-06-01 12:27:10 +02:00
2022-04-25 16:33:01 +02:00
2022-04-12 12:53:32 +02:00
2022-06-01 12:27:09 +02:00
2022-03-08 17:40:47 +01:00
2020-05-11 13:55:27 +02:00
2022-06-22 15:29:44 +02:00
2022-03-08 17:40:47 +01:00
2022-03-10 17:52:07 +01:00
2022-07-18 11:10:55 +02:00
2022-07-18 11:10:55 +02:00
2022-06-01 12:27:10 +02:00
2022-05-24 12:19:15 +02:00