LIB: speed up copyDir

Instead of using zipLazy (which does more IO than we need)
we just construct the newDest zipper from the information we
already have. This should be sufficient.
This commit is contained in:
Julian Ospald 2015-12-18 17:33:39 +01:00
parent ff40102fbe
commit aa5d29c41d
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020
1 changed files with 3 additions and 2 deletions

View File

@ -108,7 +108,7 @@ copyDir :: DirCopyMode
-> DTInfoZipper -- ^ source dir
-> DTInfoZipper -- ^ destination dir
-> IO ()
copyDir cm from@(Dir fn _ _, _) to@(Dir {}, _) = do
copyDir cm from@(Dir fn _ _, _) to@(tod@Dir {}, tobs) = do
let fromp = getFullPath from
top = getFullPath to
destdir = getFullPath to </> fn
@ -120,7 +120,8 @@ copyDir cm from@(Dir fn _ _, _) to@(Dir {}, _) = do
createDestdir destdir
newDest <- zipLazy mkDirInfo mkFileInfo destdir
ddinfo <- mkDirInfo destdir
let newDest = (Dir fn [] ddinfo, tod : tobs)
for_ (goAllDown from) $ \f ->
-- TODO: maybe do this strict?