summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/PeerWire/Selection.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-05 03:50:07 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-05 03:50:07 +0400
commit950d728dc12302858f0c20d9890dc97975f4e9a9 (patch)
tree0e69d799de4f65da1201fef8efcfad55bbd0a0c0 /src/Network/BitTorrent/PeerWire/Selection.hs
parent54efdaf9c94b813213c687b1f0e750286312de81 (diff)
~ Minor changes.
Diffstat (limited to 'src/Network/BitTorrent/PeerWire/Selection.hs')
-rw-r--r--src/Network/BitTorrent/PeerWire/Selection.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/PeerWire/Selection.hs b/src/Network/BitTorrent/PeerWire/Selection.hs
index 2e412e06..92285501 100644
--- a/src/Network/BitTorrent/PeerWire/Selection.hs
+++ b/src/Network/BitTorrent/PeerWire/Selection.hs
@@ -48,11 +48,10 @@ strictLast h a _ = findMax (difference a h)
48 48
49-- | 49-- |
50rarestFirst :: Selector 50rarestFirst :: Selector
51rarestFirst h a xs = error "rarestFirst" 51rarestFirst h a xs = rarest (frequencies (map (intersection want) xs))
52 -- rarest (frequencies (map (intersection want) xs))
53 where 52 where
54 want = difference h a 53 want = difference h a
55 rarest = undefined 54 rarest = Just . head
56 55
57-- | In general random first is faster than rarest first strategy but 56-- | In general random first is faster than rarest first strategy but
58-- only if all pieces are available. 57-- only if all pieces are available.
@@ -62,7 +61,7 @@ randomFirst = do
62 error "randomFirst" 61 error "randomFirst"
63 62
64endGame :: Selector 63endGame :: Selector
65endGame = undefined 64endGame = strictLast
66 65
67autoSelector :: Selector 66autoSelector :: Selector
68autoSelector = undefined 67autoSelector = undefined