mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-30 17:43:57 +01:00
Don't use maps:take it available in R19 only
This commit is contained in:
parent
7c2ccb2cb7
commit
5e5a8bbdcf
@ -359,11 +359,12 @@ queue_in(Key, Type, Val, {N, Seq, Q}) ->
|
||||
|
||||
-spec queue_take(term(), csi_queue()) -> {list(), csi_queue()} | error.
|
||||
queue_take(Key, {N, Seq, Q}) ->
|
||||
case maps:take(Key, Q) of
|
||||
{TypeVals, Q1} ->
|
||||
{lists:keysort(2, TypeVals), {N-length(TypeVals), Seq, Q1}};
|
||||
case maps:get(Key, Q, error) of
|
||||
error ->
|
||||
error
|
||||
error;
|
||||
TypeVals ->
|
||||
Q1 = maps:remove(Key, Q),
|
||||
{lists:keysort(2, TypeVals), {N-length(TypeVals), Seq, Q1}}
|
||||
end.
|
||||
|
||||
-spec queue_len(csi_queue()) -> non_neg_integer().
|
||||
|
Loading…
Reference in New Issue
Block a user