qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] CODING_STYLE: explicitly allow braceless 'else


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] CODING_STYLE: explicitly allow braceless 'else if'
Date: Tue, 26 Jul 2011 07:02:39 +0100

On Mon, Jul 25, 2011 at 6:00 PM, Blue Swirl <address@hidden> wrote:
> On Mon, Jul 25, 2011 at 6:55 PM, Avi Kivity <address@hidden> wrote:
>> It's already allowed by the example; there are about 1800 instances in the
>> tree; and disallowing it would lead to
>>
>>    if (a) {
>>        ...
>>    } else {
>>        if (b) {
>>            ...
>>        } else {
>>            if (c) {
>>                ...
>>            } else {
>>                if (d) {
>>                    ...
>>                } else {
>>                    ...
>>                }
>>            }
>>        }
>>    }
>>
>> instead of
>>
>>    if (a) {
>>        ...
>>    } else if (b) {
>>        ...
>>    } else if (c) {
>>        ...
>>    } else if (d) {
>>        ...
>>    } else {
>>        ...
>>    }
>>
>> which is more readable.
>>
>> Signed-off-by: Avi Kivity <address@hidden>
>
> Acked-by: Blue Swirl <address@hidden>

Yes please, I use this too.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]