unused, status: Sped up by avoiding unnecessary stats of annexed files.

Statting files returned by dirContents to see if they exist and are regular
files seems pretty useless. This code was originally part of fsck, and
perhaps the idea then was to avoid things returned by dirContents that were
not files. But it's certianly not needed in the current use cases for
getKeysPresent.
This commit is contained in:
Joey Hess 2011-08-30 15:16:34 -04:00
parent abe3b5bf78
commit ea7b1828d4
2 changed files with 2 additions and 8 deletions

View file

@ -254,15 +254,8 @@ getKeysPresent' dir = do
levela <- dirContents dir
levelb <- mapM dirContents levela
contents <- mapM dirContents (concat levelb)
files <- filterM present (concat contents)
let files = concat contents
return $ mapMaybe (fileKey . takeFileName) files
where
present d = do
result <- try $
getFileStatus $ d </> takeFileName d
case result of
Right s -> return $ isRegularFile s
Left _ -> return False
{- Things to do to record changes to content. -}
saveState :: Annex ()

1
debian/changelog vendored
View file

@ -4,6 +4,7 @@ git-annex (3.20110820) UNRELEASED; urgency=low
configured first. Closes: #638998
* The wget command will now be used in preference to curl, if available.
* init: Make description an optional parameter.
* unused, status: Sped up by avoiding unnecessary stats of annexed files.
-- Joey Hess <joeyh@debian.org> Tue, 23 Aug 2011 13:41:01 -0400