summaryrefslogtreecommitdiff
path: root/examples/dhtd.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-06-27 20:35:14 -0400
committerJoe Crayne <joe@jerkface.net>2018-06-27 20:35:14 -0400
commitedd93b41c519ddf32ed34f495f4b9a14828d71a3 (patch)
tree8897e03592a603de71a3001e5669c5d6d31842e8 /examples/dhtd.hs
parent2305a022c97b561cadcfdfa068f6bdb182dfe7c1 (diff)
More performant routeMap (IntMap -> Array).
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r--examples/dhtd.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index 3f2a6a63..8e9e7692 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -27,6 +27,7 @@ import Control.Concurrent.STM.TMChan
27import Control.Exception 27import Control.Exception
28import Control.Monad 28import Control.Monad
29import Control.Monad.IO.Class (liftIO) 29import Control.Monad.IO.Class (liftIO)
30import Data.Array.MArray (getAssocs)
30import Data.Bool 31import Data.Bool
31import Data.Char 32import Data.Char
32import Data.Conduit as C 33import Data.Conduit as C
@@ -930,7 +931,7 @@ clientSession s@Session{..} sock cnum h = do
930 ("onion", s) -> cmd0 $ do 931 ("onion", s) -> cmd0 $ do
931 now <- getPOSIXTime 932 now <- getPOSIXTime
932 join $ atomically $ do 933 join $ atomically $ do
933 rm <- readTVar $ routeMap onionRouter 934 rm <- IntMap.fromList . catMaybes . map (\(i,m) -> fmap (i,) m) <$> getAssocs (routeMap onionRouter)
934 ts <- readTVar $ trampolineNodes onionRouter 935 ts <- readTVar $ trampolineNodes onionRouter
935 tcnt <- readTVar $ trampolineCount onionRouter 936 tcnt <- readTVar $ trampolineCount onionRouter
936 icnt <- HashMap.size <$> readTVar (trampolineIds onionRouter) 937 icnt <- HashMap.size <$> readTVar (trampolineIds onionRouter)