From: Zygo Blaxell Date: Fri, 8 Jan 2010 14:16:02 +0000 (-0500) Subject: dupemerge: don't stat during the file collection loop X-Git-Tag: dm6-0.20100514~21 X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=dupemerge;a=commitdiff_plain;h=55ebeb05eb7883f9eb09976ebfe0f8ea7718e933;hp=07bccf09a4f852b9aa5e5665f6a5e1932bc755ce dupemerge: don't stat during the file collection loop Remove the lstat from the find output reading loop. It's a redundant copy of the same code in merge_files. Adjust merge_files to filter out possible non-files that will now leak through from the find output. --- diff --git a/faster-dupemerge b/faster-dupemerge index 91138c8..aa8b142 100755 --- a/faster-dupemerge +++ b/faster-dupemerge @@ -340,10 +340,11 @@ hash_file: print STDERR "\t\tDigesting file $filename\n" if $debug; if ((-l $filename) || ! -f _) { warn "Bogon file " . tick_quote($filename); - $surprises++; + $input_bogons++; + delete $inode_to_file_name{$candidate}->{$filename}; next; } - eval { + eval { $digest = digest($filename); }; if ($@) { @@ -578,12 +579,6 @@ while () { print STDERR "weak_key=$weak_key inode=$inode name=$name\n" if $debug; - unless (! (-l $name) && (-f _)) { - warn "Bogon file " . tick_quote($name); - $input_bogons++; - next; - } - $input_links++; merge_files if $weak_key ne $current_key; $current_key = $weak_key;