On Thu, May 08, 2014 at 09:45:22AM +0200, Janne Johansson wrote: > Can't say if this was the motivation here, but some people like to put > constants before variables for comparisons so as to easily catch the > difference between > if (a = 5) ... > and > if (5 = a) .. > when you really meant if (a == 5). > You are right, some people like to see constants before variables for comparisions. But if you look later in the code you see something like "if (argc != 3)" or "for (; labels < 3; labels++)". As you can see the variables are the first parameter for comparisions.
So this diff makes it more consistent what format is used, too. fritjof > > > 2014-05-08 0:13 GMT+02:00 Fritjof Bornebusch <frit...@alokat.org>: > > > Hi tech, > > > > I think "labels >= 3" is more readable than "3 <= labels". > > > > fritjof > > > > Index: merge.c > > =================================================================== > > RCS file: /cvs/src/usr.bin/rcs/merge.c,v > > retrieving revision 1.7 > > diff -u -p -r1.7 merge.c > > --- merge.c 23 Jul 2010 21:46:05 -0000 1.7 > > +++ merge.c 7 May 2014 22:10:06 -0000 > > @@ -62,7 +62,7 @@ merge_main(int argc, char **argv) > > flags |= MERGE_EFLAG; > > break; > > case 'L': > > - if (3 <= labels) > > + if (labels >= 3) > > errx(D_ERROR, "too many -L options"); > > label[labels++] = optarg; > > break; > > > > > > > -- > May the most significant bit of your life be positive.