mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 17:59:31 +02:00
Don't use maps:take it available in R19 only
This commit is contained in:
parent
7c2ccb2cb7
commit
5e5a8bbdcf
1 changed files with 5 additions and 4 deletions
|
@ -359,11 +359,12 @@ queue_in(Key, Type, Val, {N, Seq, Q}) ->
|
||||||
|
|
||||||
-spec queue_take(term(), csi_queue()) -> {list(), csi_queue()} | error.
|
-spec queue_take(term(), csi_queue()) -> {list(), csi_queue()} | error.
|
||||||
queue_take(Key, {N, Seq, Q}) ->
|
queue_take(Key, {N, Seq, Q}) ->
|
||||||
case maps:take(Key, Q) of
|
case maps:get(Key, Q, error) of
|
||||||
{TypeVals, Q1} ->
|
|
||||||
{lists:keysort(2, TypeVals), {N-length(TypeVals), Seq, Q1}};
|
|
||||||
error ->
|
error ->
|
||||||
error
|
error;
|
||||||
|
TypeVals ->
|
||||||
|
Q1 = maps:remove(Key, Q),
|
||||||
|
{lists:keysort(2, TypeVals), {N-length(TypeVals), Seq, Q1}}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
-spec queue_len(csi_queue()) -> non_neg_integer().
|
-spec queue_len(csi_queue()) -> non_neg_integer().
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue