diff options
Diffstat (limited to 'src/Network/KRPC.hs')
-rw-r--r-- | src/Network/KRPC.hs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/Network/KRPC.hs b/src/Network/KRPC.hs index 27363515..b6e14bb0 100644 --- a/src/Network/KRPC.hs +++ b/src/Network/KRPC.hs | |||
@@ -125,7 +125,6 @@ import Data.BEncode.BDict as BE | |||
125 | import Data.BEncode.Types as BE | 125 | import Data.BEncode.Types as BE |
126 | import Data.ByteString.Char8 as BC | 126 | import Data.ByteString.Char8 as BC |
127 | import Data.List as L | 127 | import Data.List as L |
128 | import Data.Map as M | ||
129 | import Data.Monoid | 128 | import Data.Monoid |
130 | import Data.Typeable | 129 | import Data.Typeable |
131 | import Network | 130 | import Network |
@@ -359,9 +358,6 @@ server :: (MonadBaseControl IO remote, MonadIO remote) | |||
359 | -> remote () | 358 | -> remote () |
360 | server servAddr handlers = do | 359 | server servAddr handlers = do |
361 | remoteServer servAddr $ \addr q -> do | 360 | remoteServer servAddr $ \addr q -> do |
362 | case dispatch (queryMethod q) of | 361 | case L.lookup (queryMethod q) handlers of |
363 | Nothing -> return $ Left $ MethodUnknown (queryMethod q) | 362 | Nothing -> return $ Left $ MethodUnknown (queryMethod q) |
364 | Just m -> m addr q | 363 | Just m -> m addr q |
365 | where | ||
366 | handlerMap = M.fromList handlers | ||
367 | dispatch s = M.lookup s handlerMap | ||