better interface for catKey'
It only needs the size, so don't require the other stuff. Should let it be used in more places, making things faster.
This commit is contained in:
parent
69dd214d59
commit
8bae692486
2 changed files with 9 additions and 4 deletions
|
@ -133,10 +133,12 @@ catFileStop = do
|
|||
|
||||
{- From ref to a symlink or a pointer file, get the key. -}
|
||||
catKey :: Ref -> Annex (Maybe Key)
|
||||
catKey ref = catKey' ref =<< catObjectMetaData ref
|
||||
catKey ref = catObjectMetaData ref >>= \case
|
||||
Just (_, sz, _) -> catKey' ref sz
|
||||
Nothing -> return Nothing
|
||||
|
||||
catKey' :: Ref -> Maybe (Sha, Integer, ObjectType) -> Annex (Maybe Key)
|
||||
catKey' ref (Just (_, sz, _))
|
||||
catKey' :: Ref -> FileSize -> Annex (Maybe Key)
|
||||
catKey' ref sz
|
||||
-- Avoid catting large files, that cannot be symlinks or
|
||||
-- pointer files, which would require buffering their
|
||||
-- content in memory, as well as a lot of IO.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue