optimisation
Avoid unnecessary conversion to/from String.
This commit is contained in:
parent
c30557594e
commit
b2222e4639
2 changed files with 5 additions and 3 deletions
|
@ -411,7 +411,7 @@ files = do
|
|||
-- so use getJournalledFilesStale which should be much smaller most
|
||||
-- of the time. branchFiles will stream as the list is consumed.
|
||||
l <- (++)
|
||||
<$> (map toRawFilePath <$> getJournalledFilesStale)
|
||||
<$> getJournalledFilesStale
|
||||
<*> pure bfs
|
||||
return (l, cleanup)
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
- Licensed under the GNU AGPL version 3 or higher.
|
||||
-}
|
||||
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Annex.Journal where
|
||||
|
||||
import Annex.Common
|
||||
|
@ -78,13 +80,13 @@ getJournalFileStale file = inRepo $ \g -> catchMaybeIO $
|
|||
{- List of existing journal files, but without locking, may miss new ones
|
||||
- just being added, or may have false positives if the journal is staged
|
||||
- as it is run. -}
|
||||
getJournalledFilesStale :: Annex [FilePath]
|
||||
getJournalledFilesStale :: Annex [RawFilePath]
|
||||
getJournalledFilesStale = do
|
||||
g <- gitRepo
|
||||
fs <- liftIO $ catchDefaultIO [] $
|
||||
getDirectoryContents $ fromRawFilePath $ gitAnnexJournalDir g
|
||||
return $ filter (`notElem` [".", ".."]) $
|
||||
map (fromRawFilePath . fileJournal . toRawFilePath) fs
|
||||
map (fileJournal . toRawFilePath) fs
|
||||
|
||||
withJournalHandle :: (DirectoryHandle -> IO a) -> Annex a
|
||||
withJournalHandle a = do
|
||||
|
|
Loading…
Add table
Reference in a new issue