25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-15 15:19:20 +02:00

Simple optimization in get_room_occupants_number command (#1964)

This commit is contained in:
Badlop 2017-09-07 18:32:26 +02:00
parent 4ecd8a0780
commit d87151aee6

View File

@ -802,7 +802,13 @@ get_room_occupants(Pid) ->
dict:to_list(S#state.users)).
get_room_occupants_number(Room, Host) ->
length(get_room_occupants(Room, Host)).
case get_room_pid(Room, Host) of
room_not_found ->
throw({error, room_not_found});
Pid ->
S = get_room_state(Pid),
dict:size(S#state.users)
end.
%%----------------------------
%% Send Direct Invitation