perf(router): employ `maps:foreach/2` instead

This commit is contained in:
Andrew Mayorov 2023-06-29 19:06:39 +02:00
parent 57da71eb1d
commit 0f25df3aa8
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 2 additions and 2 deletions

View File

@ -243,8 +243,8 @@ handle_call(Req, _From, State) ->
handle_cast({delete_routes, SessionID, Subscriptions}, State) ->
%% TODO: Make a batch for deleting all routes.
Fun = fun({Topic, _}) -> do_delete_route(Topic, SessionID) end,
ok = lists:foreach(Fun, maps:to_list(Subscriptions)),
Fun = fun(Topic, _) -> do_delete_route(Topic, SessionID) end,
ok = maps:foreach(Fun, Subscriptions),
{noreply, State};
handle_cast({resume_end, SessionID, Pid}, State) ->
case emqx_utils_ets:lookup_value(?SESSION_INIT_TAB, SessionID) of