diff options
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r-- | src/Data/Torrent.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index c3753d4f..5678d7eb 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -222,10 +222,12 @@ instance BEncodable FileInfo where | |||
222 | 222 | ||
223 | fromBEncode _ = decodingError "FileInfo" | 223 | fromBEncode _ = decodingError "FileInfo" |
224 | 224 | ||
225 | sizeInBase :: Integer -> Int -> Int | 225 | sizeInBase :: Integral a => a -> Int -> Int |
226 | sizeInBase n b = fromIntegral (n `div` fromIntegral b) + align | 226 | sizeInBase n b = fromIntegral (n `div` fromIntegral b) + align |
227 | where | 227 | where |
228 | align = if n `mod` fromIntegral b == 0 then 0 else 1 | 228 | align = if n `mod` fromIntegral b == 0 then 0 else 1 |
229 | {-# SPECIALIZE sizeInBase :: Int -> Int -> Int #-} | ||
230 | {-# SPECIALIZE sizeInBase :: Integer -> Int -> Int #-} | ||
229 | 231 | ||
230 | contentLength :: ContentInfo -> Integer | 232 | contentLength :: ContentInfo -> Integer |
231 | contentLength SingleFile { ciLength = len } = len | 233 | contentLength SingleFile { ciLength = len } = len |