Date: Thu, 7 Mar 2002 03:20:14 -0800 From: "David O'Brien" <obrien@FreeBSD.org> To: Will Andrews <will@csociety.org> Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/rwall rwall.c Message-ID: <20020307032014.B63863@dragon.nuxi.com> In-Reply-To: <20020307111707.GK53073@squall.waterspout.com>; from will@csociety.org on Thu, Mar 07, 2002 at 06:17:07AM -0500 References: <200203042027.g24KRc978637@freefall.freebsd.org> <20020307030244.B63484@dragon.nuxi.com> <20020307111707.GK53073@squall.waterspout.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Mar 07, 2002 at 06:17:07AM -0500, Will Andrews wrote: > On Thu, Mar 07, 2002 at 03:02:44AM -0800, David O'Brien wrote: > > - if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+"))) > > + fd = mkstemp(tmpname); > > + fp = fdopen(fd, "r+"); > > + if (fd == -1 || !fp) > > > > Why did you need to do such code restructuring? > > In my opinion, the above change makes the code clearer. The > previous construct obfuscates the logic. 1. that is not sufficient reason to arbitrarily change working code. 2. please review the C idiom of short-circuit evaluation. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020307032014.B63863>