From 8b817ae44034b5a0740df369c002e8953a530840 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Thu, 28 Jun 2018 19:22:00 -0400 Subject: More performant pendingRoutes (IntMap -> Array). --- src/Network/Tox/Onion/Transport.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/Network/Tox/Onion/Transport.hs') diff --git a/src/Network/Tox/Onion/Transport.hs b/src/Network/Tox/Onion/Transport.hs index e2e136ae..7ed9702a 100644 --- a/src/Network/Tox/Onion/Transport.hs +++ b/src/Network/Tox/Onion/Transport.hs @@ -250,12 +250,9 @@ encodeOnionAddr crypto getRoute (msg,OnionDestination _ ni (Just rid)) = do req <- wrapForRoute crypto msg ni route return ( runPut $ putRequest req , nodeAddr $ routeNodeA route) - mapM' f x = do - let _ = x :: Maybe OnionRoute - -- dput XMisc $ "ONION encode sending to " ++ show ni - -- dput XMisc $ "ONION encode getRoute -> " ++ show (fmap (\y -> map ($ y) [routeNodeA,routeNodeB,routeNodeC]) x) - mapM f x -- ONION encode getRoute -> Nothing - getRoute ni rid >>= mapM' go + m <- {-# SCC "encodeOnionAddr.getRoute" #-} getRoute ni rid + x <- {-# SCC "encodeOnionAddr.wrapForRoute" #-} mapM go m + return x forwardOnions :: TransportCrypto -> UDPTransport -> UDPTransport -- cgit v1.2.3