diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-11 14:43:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-11 14:43:45 -0400 |
commit | b505ba83e8b62a9ed0ec2fb96448c5fc801184d9 (patch) | |
tree | 664eb4af9f274dfc13eb9abfab86421ebe38e881 /Backend | |
parent | 025ded4a2dfb58a6ec0cb47b9d625d593a4e1977 (diff) |
minor syntax changes
Diffstat (limited to 'Backend')
-rw-r--r-- | Backend/SHA.hs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Backend/SHA.hs b/Backend/SHA.hs index 4b5b14cc3..3a54a8871 100644 --- a/Backend/SHA.hs +++ b/Backend/SHA.hs @@ -104,11 +104,11 @@ checkKeyChecksum size key = do present <- liftIO $ doesFileExist file if not present || fast then return True - else do - s <- shaN size file - if s == dropExtension (keyName key) - then return True - else do - dest <- moveBad key - warning $ "Bad file content; moved to " ++ dest - return False + else check =<< shaN size file + where + check s + | s == dropExtension (keyName key) = return True + | otherwise = do + dest <- moveBad key + warning $ "Bad file content; moved to " ++ dest + return False |