From 2f99841240904b6a487c9216b410e3e34e8506ac Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 17 May 2011 19:56:31 +0200 Subject: Improve $hashl->add_file --- bin/hashl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'bin/hashl') diff --git a/bin/hashl b/bin/hashl index 3f03789..4877e87 100755 --- a/bin/hashl +++ b/bin/hashl @@ -162,17 +162,12 @@ sub db_update { my ($file, $path) = @_; my ($size, $mtime) = (stat($path))[7,9]; - if ($hashl->file($file) and - $hashl->file($file)->{mtime} == $mtime and - $hashl->file($file)->{size} == $size ) { - return; - } - - $hashl->add_file($file, { - hash => $hashl->hash_file($path), + $hashl->add_file( + file => $file, mtime => $mtime, + path => $path, size => $size, - }); + ); } sub db_ignore { -- cgit v1.2.3