make catObjectStream support newline and carriage return in filenames
Turns out the %(rest) trick was not needed. Instead, just maintain a list of files we've asked for, and each cat-file response is for the next file in the list. This actually benchmarks 25% faster than before! Very surprising, but it must be due to needing to shove less data through the pipe, and parse less.
This commit is contained in:
parent
2cf6717aec
commit
de3d7d044d
4 changed files with 34 additions and 37 deletions
|
@ -6,7 +6,9 @@
|
|||
- Unlike a TQueue, the entire contents of a TList can be efficiently
|
||||
- read without modifying it.
|
||||
-
|
||||
- Copyright 2013 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2013-2020 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- License: BSD-2-clause
|
||||
-}
|
||||
|
||||
{-# LANGUAGE BangPatterns #-}
|
||||
|
@ -21,6 +23,7 @@ module Utility.TList (
|
|||
consTList,
|
||||
snocTList,
|
||||
appendTList,
|
||||
headTList,
|
||||
) where
|
||||
|
||||
import Common
|
||||
|
@ -77,3 +80,6 @@ snocTList tlist v = modifyTList tlist $ \dl -> D.snoc dl v
|
|||
|
||||
appendTList :: TList a -> [a] -> STM ()
|
||||
appendTList tlist l = modifyTList tlist $ \dl -> D.append dl (D.fromList l)
|
||||
|
||||
headTList :: TList a -> STM a
|
||||
headTList tlist = D.head <$> readTMVar tlist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue