got rid of almost all 'return ()'

This commit is contained in:
Joey Hess 2010-10-28 12:40:05 -04:00
parent 9c7b3dce9e
commit 045b051ec1
9 changed files with 30 additions and 50 deletions

14
UUID.hs
View file

@ -63,10 +63,7 @@ getUUID r = do
where
uncached r = Git.configGet r "annex.uuid" ""
cached r g = Git.configGet g (cachekey r) ""
updatecache g r u = do
if (g /= r)
then setConfig (cachekey r) u
else return ()
updatecache g r u = when (g /= r) $ setConfig (cachekey r) u
cachekey r = "remote." ++ (Git.repoRemoteName r) ++ ".annex-uuid"
{- Make sure that the repo has an annex.uuid setting. -}
@ -74,11 +71,9 @@ prepUUID :: Annex ()
prepUUID = do
g <- Annex.gitRepo
u <- getUUID g
if ("" == u)
then do
uuid <- liftIO $ genUUID
setConfig configkey uuid
else return ()
when ("" == u) $ do
uuid <- liftIO $ genUUID
setConfig configkey uuid
{- Changes a git config setting in both internal state and .git/config -}
setConfig :: String -> String -> Annex ()
@ -88,7 +83,6 @@ setConfig key value = do
-- re-read git config and update the repo's state
g' <- liftIO $ Git.configRead g
Annex.gitRepoChange g'
return ()
{- Filters a list of repos to ones that have listed UUIDs. -}
reposByUUID :: [Git.Repo] -> [UUID] -> Annex [Git.Repo]