summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2012-05-26 11:01:24 +0100
committerMatthias Radestock <matthias@rabbitmq.com>2012-05-26 11:01:24 +0100
commitf5fcca05b2074f5f85a86ca90c2195ca1ef534df (patch)
tree9efdc861a7d8a7b529af4d76b5c7cb46fdbd3243
parent2a64746633dcf5f0c7b20ba6e73f92ead21282c8 (diff)
downloadrabbitmq-server-f5fcca05b2074f5f85a86ca90c2195ca1ef534df.tar.gz
cosmetic(ish)
-rw-r--r--src/rabbit_variable_queue.erl18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl
index dafb3f2e..49213c95 100644
--- a/src/rabbit_variable_queue.erl
+++ b/src/rabbit_variable_queue.erl
@@ -1466,16 +1466,14 @@ reduce_memory_use(AlphaBetaFun, BetaDeltaFun, AckFun,
%% determined based on which is growing faster. Whichever
%% comes second may very well get a quota of 0 if the
%% first manages to push out the max number of messages.
- S1 -> {_, State2} =
- lists:foldl(fun (ReduceFun, {QuotaN, StateN}) ->
- ReduceFun(QuotaN, StateN)
- end,
- {S1, State},
- case (AvgAckIngress - AvgAckEgress) >
- (AvgIngress - AvgEgress) of
- true -> [AckFun, AlphaBetaFun];
- false -> [AlphaBetaFun, AckFun]
- end),
+ S1 -> Funs = case ((AvgAckIngress - AvgAckEgress) >
+ (AvgIngress - AvgEgress)) of
+ true -> [AckFun, AlphaBetaFun];
+ false -> [AlphaBetaFun, AckFun]
+ end,
+ {_, State2} = lists:foldl(fun (ReduceFun, {QuotaN, StateN}) ->
+ ReduceFun(QuotaN, StateN)
+ end, {S1, State}, Funs),
{true, State2}
end,