[1/5] cmd: WCMD_delete: simplify logic, avoid assigning variable to itself

Henri Verbeet hverbeet at gmail.com
Mon May 2 05:42:33 CDT 2011


On 2 May 2011 02:23, Dan Kegel <dank at kegel.com> wrote:
> -                    if (attribute && !negate) {
> -                        stillOK = stillOK;
> -                    } else if (!attribute && negate) {
> -                        stillOK = stillOK;
> -                    } else {
> +                    if (attribute == negate)
>                          stillOK = FALSE;
> -                    }
If you just write that as "if (!attribute == !negate)" you avoid both
the assumption that TRUE is defined to 1 and the ugly "!= 0"'s. Or you
could build actual attribute masks first and compare those instead,
which may even be readable.



More information about the wine-devel mailing list