Subject: Re: CVS commit: src/distrib/utils/sysinst
To: David Laight <david@l8s.co.uk>
From: Hubert Feyrer <hubert.feyrer@informatik.fh-regensburg.de>
List: source-changes
Date: 07/22/2003 01:01:38
On Mon, 21 Jul 2003, David Laight wrote:
> > David Laight <dsl@netbsd.org> writes:
> > > Change a lot of 'if (strlen(x) == 0)' to 'if (x[0] === 0)'.
> >
> > Why bother? Was this performance critical code? The former is clearer
> > to the reader.
>
> IMHO the latter is clearer, the test is 'is this string null' not
> 'does it have zero length'.  I'll often write 'if (!*x)' to save keystrokes!

FWIW, i find the strlen(x)==0 thing most readable.


 - Hubert

-- 
Want to get a clue on IPv6 but don't know where to start? Try this:
* Basics -> http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html
* Setup  -> http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html
Of course with your #1 IPv6 ready operating system -> http://www.NetBSD.org/