diff options
author | Sam T <pxqr.sta@gmail.com> | 2013-05-05 03:50:07 +0400 |
---|---|---|
committer | Sam T <pxqr.sta@gmail.com> | 2013-05-05 03:50:07 +0400 |
commit | 950d728dc12302858f0c20d9890dc97975f4e9a9 (patch) | |
tree | 0e69d799de4f65da1201fef8efcfad55bbd0a0c0 /src/Network/BitTorrent/PeerWire/Selection.hs | |
parent | 54efdaf9c94b813213c687b1f0e750286312de81 (diff) |
~ Minor changes.
Diffstat (limited to 'src/Network/BitTorrent/PeerWire/Selection.hs')
-rw-r--r-- | src/Network/BitTorrent/PeerWire/Selection.hs | 7 |
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 | -- | |
50 | rarestFirst :: Selector | 50 | rarestFirst :: Selector |
51 | rarestFirst h a xs = error "rarestFirst" | 51 | rarestFirst 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 | ||
64 | endGame :: Selector | 63 | endGame :: Selector |
65 | endGame = undefined | 64 | endGame = strictLast |
66 | 65 | ||
67 | autoSelector :: Selector | 66 | autoSelector :: Selector |
68 | autoSelector = undefined | 67 | autoSelector = undefined |