Skip to content

Commit e0336d9

Browse files
author
Daniil Fedotov
committed
Replace update_with with find and put
update_with is not defined in OTP-18.3
1 parent c4519dd commit e0336d9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rabbit_msg_store.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,11 @@ update_pending_confirms(Fun, CRef,
13371337
record_pending_confirm(CRef, MsgId, State) ->
13381338
update_pending_confirms(
13391339
fun (_MsgOnDiskFun, CTM) ->
1340-
maps:update_with(CRef,
1341-
fun (MsgIds) -> gb_sets:add(MsgId, MsgIds) end,
1342-
gb_sets:singleton(MsgId), CTM)
1340+
NewMsgIds = case maps:find(CRef, CTM) of
1341+
error -> gb_sets:singleton(MsgId);
1342+
{ok, MsgIds} -> gb_sets:add(MsgId, MsgIds)
1343+
end,
1344+
maps:put(CRef, NewMsgIds, CTM)
13431345
end, CRef, State).
13441346

13451347
client_confirm(CRef, MsgIds, ActionTaken, State) ->

0 commit comments

Comments
 (0)