summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/PeerWire/Selection.hs
diff options
context:
space:
mode:
authorSam T <pxqr.sta@gmail.com>2013-05-05 02:57:06 +0400
committerSam T <pxqr.sta@gmail.com>2013-05-05 02:57:06 +0400
commit9b6024c9e3eca884d897bd6a3f033ea5648f7df2 (patch)
tree89c4354cade8ea71ea281a0089b11820a03fea1d /src/Network/BitTorrent/PeerWire/Selection.hs
parentbf3005952658130aaa83d8e8678c6ea7b36e45cb (diff)
+ Add some benchs.
Diffstat (limited to 'src/Network/BitTorrent/PeerWire/Selection.hs')
-rw-r--r--src/Network/BitTorrent/PeerWire/Selection.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/PeerWire/Selection.hs b/src/Network/BitTorrent/PeerWire/Selection.hs
index 04049812..2e412e06 100644
--- a/src/Network/BitTorrent/PeerWire/Selection.hs
+++ b/src/Network/BitTorrent/PeerWire/Selection.hs
@@ -23,7 +23,8 @@
23-- 23--
24module Network.BitTorrent.PeerWire.Selection 24module Network.BitTorrent.PeerWire.Selection
25 ( Selector 25 ( Selector
26 , strictFirst, rarestFirst, randomFirst, endGame, autoSelector 26 , strictFirst, strictLast
27 , rarestFirst, randomFirst, endGame, autoSelector
27 ) where 28 ) where
28 29
29import Network.BitTorrent.PeerWire.Block 30import Network.BitTorrent.PeerWire.Block
@@ -41,6 +42,9 @@ type Selector = Bitfield -- ^ Indices of client "have" pieces.
41strictFirst :: Selector 42strictFirst :: Selector
42strictFirst h a _ = findMin (difference a h) 43strictFirst h a _ = findMin (difference a h)
43 44
45-- | Select the last available piece.
46strictLast :: Selector
47strictLast h a _ = findMax (difference a h)
44 48
45-- | 49-- |
46rarestFirst :: Selector 50rarestFirst :: Selector