use DList for the transfer queue

Some nice efficiency gains here for list appending, although mostly
the small size of the transfer queue makes them irrelivant.
This commit is contained in:
Joey Hess 2013-04-25 01:33:44 -04:00
parent c6da464051
commit 362ed9f0e3
4 changed files with 21 additions and 16 deletions

View file

@ -16,7 +16,7 @@ import Utility.TList
data TransferQueue = TransferQueue
{ queuesize :: TVar Int
, queuelist :: TVar [(Transfer, TransferInfo)]
, queuelist :: TList (Transfer, TransferInfo)
, deferreddownloads :: TList (Key, AssociatedFile)
}
@ -26,5 +26,5 @@ data Schedule = Next | Later
newTransferQueue :: IO TransferQueue
newTransferQueue = atomically $ TransferQueue
<$> newTVar 0
<*> newTVar []
<*> newTList
<*> newTList