From: Ramakrishnan Muthukrishnan Date: Fri, 4 Sep 2015 06:38:58 +0000 (+0530) Subject: remove a few reduntant stuff X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/%22news.html/status?a=commitdiff_plain;h=720be7499c24343ac9d63e0b2f5fc510f2785c7b;p=functorrent.git remove a few reduntant stuff --- diff --git a/src/FuncTorrent/Peer.hs b/src/FuncTorrent/Peer.hs index ae95f83..cfefb11 100644 --- a/src/FuncTorrent/Peer.hs +++ b/src/FuncTorrent/Peer.hs @@ -129,7 +129,7 @@ handlePeerMsgs p m peerId = do fileName = name (info m) pieceStatus = mkPieceMap numPieces pieceHash (splitNum fileLen pLen) createDummyFile fileName (fromIntegral fileLen) - (r, _) <- runStateT (msgLoop pieceStatus fileName) pstate + _ <- runStateT (msgLoop pieceStatus fileName) pstate return () msgLoop :: PieceMap -> FilePath -> StateT PState IO () @@ -142,7 +142,7 @@ msgLoop pieceStatus file = do gets peer >>= (\p -> liftIO $ putStrLn $ "--> InterestedMsg to peer: " ++ show p) modify (\st -> st { meInterested = True }) msgLoop pieceStatus file - PState { meInterested = True, heChoking = False } -> do + PState { meInterested = True, heChoking = False } -> case pickPiece pieceStatus of Nothing -> liftIO $ putStrLn "Nothing to download" Just workPiece -> do