<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 20, 2022 at 3:41 PM Peter Krempa <<a href="mailto:pkrempa@redhat.com">pkrempa@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jul 20, 2022 at 15:11:12 +0200, Kristina Hanicova wrote:<br>
> Signed-off-by: Kristina Hanicova <<a href="mailto:khanicov@redhat.com" target="_blank">khanicov@redhat.com</a>><br>
> ---<br>
>  src/conf/domain_conf.c | 8 ++------<br>
>  1 file changed, 2 insertions(+), 6 deletions(-)<br>
> <br>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c<br>
> index e52f39c809..b600bfec31 100644<br>
> --- a/src/conf/domain_conf.c<br>
> +++ b/src/conf/domain_conf.c<br>
> @@ -4206,12 +4206,8 @@ virDomainObjGetOneDefState(virDomainObj *vm,<br>
>      if (virDomainObjUpdateModificationImpact(vm, &flags) < 0)<br>
>          return NULL;<br>
>  <br>
> -    if (live) {<br>
> -        if (flags & VIR_DOMAIN_AFFECT_LIVE)<br>
> -            *live = true;<br>
> -        else<br>
> -            *live = false;<br>
> -    }<br>
> +    if (live)<br>
> +        *live = (flags & VIR_DOMAIN_AFFECT_LIVE) ? true : false;<br>
>  <br>
<br>
<a href="https://libvirt.org/coding-style.html#conditional-expressions" rel="noreferrer" target="_blank">https://libvirt.org/coding-style.html#conditional-expressions</a><br>
<br>
We suggest that new code avoids ternary operators.<br>
<br>
I'd prefer if this patch is dropped.<br>
<br></blockquote><div><br></div><div>I think that it is reasonably used in this case and makes the code much 
more readable. Also its simple enough, no nesting or spanning more 
lines....</div><div><br></div><div><br></div><div>Kristina<br></div></div></div>