On Tue,  2 Oct 2012 at 23:45:45 +0200, Rodolfo García Peñas wrote:
> 
> This patch reviews the code style in framewin.c, removing some
> curly brackets not needed.
> 
> This patch removes some lines commented and join two "if's" in one.

>  
> -     if (wPreferences.new_style == TS_NEW) {
> -             if (!fwin->flags.hide_right_button && fwin->right_button && 
> !fwin->flags.rbutton_dont_fit) {
> -                     w -= fwin->right_button->width;
> -             }
> -     }
> +     if ((wPreferences.new_style == TS_NEW) &&
> +         (!fwin->flags.hide_right_button &&
> +          fwin->right_button &&
> +          !fwin->flags.rbutton_dont_fit))
> +             w -= fwin->right_button->width;


I prefer the old version, it reads better and the "intention" of the
code is clearer. Furthermore, the statement w -= ... stands out
in the old version, whereas in this patch it kind of mixes with the
many conditionals in the if.

I'm probably going to apply it in order to avoid too much trouble
for you. But please don't simply join ifs together just because
it's mathematically equivalent. The intentions are important.


-- 
To unsubscribe, send mail to [email protected].

Reply via email to