diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/BitTorrent/Exchange/Block.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/Exchange/Block.hs b/src/Network/BitTorrent/Exchange/Block.hs index 0f437381..6e5b960a 100644 --- a/src/Network/BitTorrent/Exchange/Block.hs +++ b/src/Network/BitTorrent/Exchange/Block.hs | |||
@@ -317,8 +317,9 @@ spans expectedSize = go 0 | |||
317 | 317 | ||
318 | -- | /O(1)/. A new empty bucket capable to alloof specified size. | 318 | -- | /O(1)/. A new empty bucket capable to alloof specified size. |
319 | empty :: PieceSize -> Bucket | 319 | empty :: PieceSize -> Bucket |
320 | empty 0 = error "empty: Bucket size is zero" | 320 | empty sz |
321 | empty sz = Span sz Nil | 321 | | sz < 0 = error "empty: Bucket size must be a non-negative value" |
322 | | otherwise = Span sz Nil | ||
322 | {-# INLINE empty #-} | 323 | {-# INLINE empty #-} |
323 | 324 | ||
324 | insertSpan :: Pos -> BS.ByteString -> ChunkSize -> Bucket -> Bucket | 325 | insertSpan :: Pos -> BS.ByteString -> ChunkSize -> Bucket -> Bucket |