diff options
Diffstat (limited to 'Backend')
-rw-r--r-- | Backend/Hash.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Backend/Hash.hs b/Backend/Hash.hs index 7967b1714..77e964bad 100644 --- a/Backend/Hash.hs +++ b/Backend/Hash.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} +{-# LANGUAGE BangPatterns, CPP #-} module Backend.Hash ( backends, @@ -171,7 +171,9 @@ hashFile hash file filesize = go hash go (SHA3Hash hashsize) = use (sha3Hasher hashsize) go (SkeinHash hashsize) = use (skeinHasher hashsize) - use hasher = liftIO $ hasher <$> L.readFile file + use hasher = liftIO $ do + !h <- hasher <$> L.readFile file + return h usehasher hashsize = case shaHasher hashsize filesize of Left sha -> use sha |