fts: avoid unnecessary strlen calls
commit85dd7d7fd9cdfd004c95287dd55575ba6118bb69
authorBernhard Voelker <mail@bernhard-voelker.de>
Wed, 9 Apr 2014 12:14:08 +0000 (9 14:14 +0200)
committerPádraig Brady <P@draigBrady.com>
Wed, 9 Apr 2014 14:24:37 +0000 (9 15:24 +0100)
treed3ef79d60e0a9458f25df82efa1428faedd31be6
parent8f6c54d191839962d35c99c9bb537a302aab5717
fts: avoid unnecessary strlen calls

* lib/fts.c (_D_EXACT_NAMLEN): Remove macro.
(fts_build): Store the length of the dp->d_name entry in a local variable
instead of calling strlen() several times via the above, removed macro.
For 'rm -rf some-dir' with e.g. 1M directory entries, this speeds up the
run by ~4%, and reduces the execution time by about a third if run
via "ltrace -c rm -rf some-dir".
ChangeLog
lib/fts.c