El Martes, 25 de Octubre de 2005 16:03, Jeremy Huntwork escribió:
> The idea of keeping the code cleaner by using a function is nice,
> however I disagree that this is more readable.
At least to me the version using "case" is more hard to read and isn't as
flexible as the "_IS_" function. The "_IS_" function can be used in places
where "case" don't fit very well.
For example, this
# If no .config file is supplied, the kernel build is skipped
if [ -z $CONFIG ] ; then
if echo $script | grep -q "kernel" ; then
continue
fi
fi
has been simplified to
# If no .config file is supplied, the kernel build is skipped
if [ -z $CONFIG ] && [[ `_IS_ $i kernel` ]] ; then
continue
fi
How that would look using "case"?
> Plus it appears that it
> would just be that much slower because we're using if and case in
> tandem, when a case alone would have sufficed.
The Makefile creation take less than 5 seconds on a slow machine using any of
the jhalfs versions (the old one, the new one, the "case" based one, or the
"regexp" based one.). I can't see a perfomance issue on that when the full
build process could take several hours.
--
Manuel Canales Esparcia
Usuario de LFS nº2886: http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.com
TLDP-ES: http://es.tldp.org
--
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page