diff options
Diffstat (limited to 'src/Data')
-rw-r--r-- | src/Data/Torrent.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index 2b303b80..8e837b56 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -56,6 +56,7 @@ module Data.Torrent | |||
56 | , Data.Torrent.hash | 56 | , Data.Torrent.hash |
57 | , Data.Torrent.hashlazy | 57 | , Data.Torrent.hashlazy |
58 | , layoutOffsets | 58 | , layoutOffsets |
59 | , slice | ||
59 | -- #endif | 60 | -- #endif |
60 | ) where | 61 | ) where |
61 | 62 | ||
@@ -464,14 +465,17 @@ fileOffset fullPath | |||
464 | isSingleFile :: ContentInfo -> Bool | 465 | isSingleFile :: ContentInfo -> Bool |
465 | isSingleFile SingleFile {} = True | 466 | isSingleFile SingleFile {} = True |
466 | isSingleFile _ = False | 467 | isSingleFile _ = False |
468 | {-# INLINE isSingleFile #-} | ||
467 | 469 | ||
468 | -- | Test if this is multifile torrent. | 470 | -- | Test if this is multifile torrent. |
469 | isMultiFile :: ContentInfo -> Bool | 471 | isMultiFile :: ContentInfo -> Bool |
470 | isMultiFile MultiFile {} = True | 472 | isMultiFile MultiFile {} = True |
471 | isMultiFile _ = False | 473 | isMultiFile _ = False |
474 | {-# INLINE isMultiFile #-} | ||
472 | 475 | ||
473 | slice :: Int -> Int -> ByteString -> ByteString | 476 | slice :: Int -> Int -> ByteString -> ByteString |
474 | slice from to = B.take to . B.drop from | 477 | slice from siz = B.take siz . B.drop from |
478 | {-# INLINE slice #-} | ||
475 | 479 | ||
476 | -- | Extract validation hash by specified piece index. | 480 | -- | Extract validation hash by specified piece index. |
477 | pieceHash :: ContentInfo -> Int -> ByteString | 481 | pieceHash :: ContentInfo -> Int -> ByteString |