ByteString Ref continued
Several nice speed wins I think. At 340/633 files converted.
This commit is contained in:
parent
d5d8259937
commit
6c81e0c8f1
16 changed files with 124 additions and 99 deletions
|
@ -16,8 +16,8 @@ import Git.Sha
|
|||
|
||||
import qualified Data.Set as S
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Char8 as B8
|
||||
import qualified Data.ByteString.Lazy.Char8 as L8
|
||||
|
||||
data History t = History t (S.Set (History t))
|
||||
deriving (Show, Eq, Ord)
|
||||
|
@ -56,8 +56,8 @@ getHistoryToDepth n commit r = do
|
|||
!h <- fmap (truncateHistoryToDepth n)
|
||||
. build Nothing
|
||||
. map parsehistorycommit
|
||||
. map B.copy
|
||||
. B8.lines
|
||||
. map L.toStrict
|
||||
. L8.lines
|
||||
<$> L.hGetContents inh
|
||||
hClose inh
|
||||
void $ waitForProcess pid
|
||||
|
@ -97,7 +97,7 @@ getHistoryToDepth n commit r = do
|
|||
, Param "--format=%T %H %P"
|
||||
]
|
||||
|
||||
parsehistorycommit l = case map extractSha (S8.split ' ' l) of
|
||||
parsehistorycommit l = case map extractSha (B8.split ' ' l) of
|
||||
(Just t:Just c:ps) -> Just $
|
||||
( HistoryCommit
|
||||
{ historyCommit = c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue