Re: if/else coding style :-)

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

 



On 10/13/2014 08:01 AM, Pranith Kumar Karampuri wrote:
hi,
      Why are we moving away from this coding style?:
if (x) {
/*code*/
} else {
/* code */
}

This patch (in master) introduces the same and explains why,

commit 0a8371bdfdd88e662d09def717cc0b822feb64e8
Author: Jeff Darcy <jdarcy@xxxxxxxxxx>
Date:   Mon Sep 29 17:27:14 2014 -0400

    extras: reverse test for '}' vs. following 'else' placement

    The two-line form "}\nelse {" has been more common than the one-line
    form "} else {" in our code for years, and IMO for good reason (see
    the comment in the diff).

    Change-Id: Ic22c76fe76f0d91300daff36e755a18a8db58852
    Signed-off-by: Jeff Darcy <jdarcy@xxxxxxxxxx>
    Reviewed-on: http://review.gluster.org/8888
    Tested-by: Gluster Build System <jenkins@xxxxxxxxxxxxxxxxx>
    Reviewed-by: Vijay Bellur <vbellur@xxxxxxxxxx>

Shyam
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://supercolony.gluster.org/mailman/listinfo/gluster-devel




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux