summaryrefslogtreecommitdiff
path: root/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'src/Data')
-rw-r--r--src/Data/Torrent.hs6
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
464isSingleFile :: ContentInfo -> Bool 465isSingleFile :: ContentInfo -> Bool
465isSingleFile SingleFile {} = True 466isSingleFile SingleFile {} = True
466isSingleFile _ = False 467isSingleFile _ = False
468{-# INLINE isSingleFile #-}
467 469
468-- | Test if this is multifile torrent. 470-- | Test if this is multifile torrent.
469isMultiFile :: ContentInfo -> Bool 471isMultiFile :: ContentInfo -> Bool
470isMultiFile MultiFile {} = True 472isMultiFile MultiFile {} = True
471isMultiFile _ = False 473isMultiFile _ = False
474{-# INLINE isMultiFile #-}
472 475
473slice :: Int -> Int -> ByteString -> ByteString 476slice :: Int -> Int -> ByteString -> ByteString
474slice from to = B.take to . B.drop from 477slice 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.
477pieceHash :: ContentInfo -> Int -> ByteString 481pieceHash :: ContentInfo -> Int -> ByteString