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:
parent
abe3b5bf78
commit
ea7b1828d4
2 changed files with 2 additions and 8 deletions
|
@ -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 ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue