diff options
Diffstat (limited to 'src/Network/BitTorrent/Exchange/Block.hs')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Block.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Network/BitTorrent/Exchange/Block.hs b/src/Network/BitTorrent/Exchange/Block.hs index d713bcf1..c910a716 100644 --- a/src/Network/BitTorrent/Exchange/Block.hs +++ b/src/Network/BitTorrent/Exchange/Block.hs | |||
@@ -43,6 +43,7 @@ module Network.BitTorrent.Exchange.Block | |||
43 | -- ** Construction | 43 | -- ** Construction |
44 | , Network.BitTorrent.Exchange.Block.empty | 44 | , Network.BitTorrent.Exchange.Block.empty |
45 | , Network.BitTorrent.Exchange.Block.insert | 45 | , Network.BitTorrent.Exchange.Block.insert |
46 | , Network.BitTorrent.Exchange.Block.insertLazy | ||
46 | , Network.BitTorrent.Exchange.Block.merge | 47 | , Network.BitTorrent.Exchange.Block.merge |
47 | 48 | ||
48 | -- ** Rendering | 49 | -- ** Rendering |
@@ -319,6 +320,10 @@ insert dstPos bs bucket = go 0 bucket | |||
319 | | intersects curPos sz = bkt | 320 | | intersects curPos sz = bkt |
320 | | otherwise = fill sz br (go (curPos + sz) xs) | 321 | | otherwise = fill sz br (go (curPos + sz) xs) |
321 | 322 | ||
323 | -- TODO zero-copy | ||
324 | insertLazy :: Pos -> BL.ByteString -> Bucket -> Bucket | ||
325 | insertLazy pos bl = Network.BitTorrent.Exchange.Block.insert pos (BL.toStrict bl) | ||
326 | |||
322 | -- | /O(n)/. | 327 | -- | /O(n)/. |
323 | merge :: Bucket -> Bucket -> Bucket | 328 | merge :: Bucket -> Bucket -> Bucket |
324 | merge = undefined | 329 | merge = undefined |