summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul J. Davis <paul.joseph.davis@gmail.com>2014-01-31 02:55:57 -0600
committerRobert Newson <rnewson@apache.org>2014-07-23 18:06:43 +0100
commit23cda378322851e8d09c850510ed75119cc83adf (patch)
tree1eed86b6bb6931ddb1ef59c432c54e72e850f4f8
parente13e16f6a0b12985ae95b9fc220321f25a078f8a (diff)
downloadcouchdb-23cda378322851e8d09c850510ed75119cc83adf.tar.gz
Slight style tweaks to rexi_buffer hibernation
Avoid using a possibly misleading variable name by not naming it. Alternatively, this is not the variable name you are looking for. BugzId: 27672
-rw-r--r--src/rexi_buffer.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rexi_buffer.erl b/src/rexi_buffer.erl
index 880e4dd6c..874ec3c87 100644
--- a/src/rexi_buffer.erl
+++ b/src/rexi_buffer.erl
@@ -72,16 +72,17 @@ handle_info(timeout, #state{sender = nil} = State) ->
if Sender =:= nil, C > 1 ->
{noreply, State#state{buffer = Q2, count = C-1}, 0};
true ->
+ NewState = State#state{buffer = Q2, sender = Sender, count = C-1},
% When Sender is nil and C-1 == 0 we're reverting to an
% idle state with no outstanding or queued messages. We'll
% use this oppurtunity to hibernate this process and
% run a garbage collection.
- Timeout = case {Sender, C-1} of
- {nil, 0} -> hibernate;
- _ -> infinity
- end,
- NewState = State#state{buffer = Q2, sender = Sender, count = C-1},
- {noreply, NewState, Timeout}
+ case {Sender, C-1} of
+ {nil, 0} ->
+ {noreply, NewState, hibernate};
+ _ ->
+ {noreply, NewState, infinity}
+ end
end;
handle_info(timeout, State) ->
% Waiting on a sender to return