From aa5d29c41d416f3e787b04637ae4f44d909d6751 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 18 Dec 2015 17:33:39 +0100 Subject: [PATCH] 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. --- src/IO/File.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/IO/File.hs b/src/IO/File.hs index a496456..bf95be5 100644 --- a/src/IO/File.hs +++ b/src/IO/File.hs @@ -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?