summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2014-01-22 23:25:27 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2014-01-22 23:25:27 +0000
commit12159aa2d3f5d18986e6550b0be8240d4588aaab (patch)
treebe49bd1d49e7187d2fffa4d5a108579f626d13df
parent8b5f304474d529bce7ad7e0be8e00392baffbf8c (diff)
downloadrabbitmq-server-12159aa2d3f5d18986e6550b0be8240d4588aaab.tar.gz
some drive-by inlining
not strictly part of this bug but easier here than on default
-rw-r--r--src/rabbit_channel.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 1da4b0fd..45868ceb 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -352,9 +352,10 @@ handle_cast({mandatory_received, MsgSeqNo}, State = #ch{mandatory = Mand}) ->
%% NB: don't call noreply/1 since we don't want to send confirms.
noreply_coalesce(State#ch{mandatory = dtree:drop(MsgSeqNo, Mand)});
-handle_cast({confirm, MsgSeqNos, From}, State) ->
+handle_cast({confirm, MsgSeqNos, QPid}, State = #ch{unconfirmed = UC}) ->
+ {MXs, UC1} = dtree:take(MsgSeqNos, QPid, UC),
%% NB: don't call noreply/1 since we don't want to send confirms.
- noreply_coalesce(confirm(MsgSeqNos, From, State)).
+ noreply_coalesce(record_confirms(MXs, State#ch{unconfirmed = UC1})).
handle_info({bump_credit, Msg}, State) ->
credit_flow:handle_bump_msg(Msg),
@@ -625,12 +626,6 @@ record_confirms([], State) ->
record_confirms(MXs, State = #ch{confirmed = C}) ->
State#ch{confirmed = [MXs | C]}.
-confirm([], _QPid, State) ->
- State;
-confirm(MsgSeqNos, QPid, State = #ch{unconfirmed = UC}) ->
- {MXs, UC1} = dtree:take(MsgSeqNos, QPid, UC),
- record_confirms(MXs, State#ch{unconfirmed = UC1}).
-
handle_method(#'channel.open'{}, _, State = #ch{state = starting}) ->
%% Don't leave "starting" as the state for 5s. TODO is this TRTTD?
State1 = State#ch{state = running},