]> git.notmuchmail.org Git - notmuch/commitdiff
add_files_recursive: Separate scanning for directories and files for legibility.
authorCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 00:35:02 +0000 (16:35 -0800)
committerCarl Worth <cworth@cworth.org>
Wed, 6 Jan 2010 18:32:06 +0000 (10:32 -0800)
We now do two scans over the entries returned from scandir. The first
scan is looking for directories (and making the recursive call). The
second scan is looking for new files to add to the database.

This is easier to read than the previous code which had a single loop
and some if statements with ridiculously long bodies. It also has the
advantage that once the directory scan is complete we can do a single
comparison of the filesystem and database mtimes and entirely skip the
second scan if it's not needed.


No differences found