summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2010-01-21 11:16:07 +0000
committerMatthew Sackman <matthew@lshift.net>2010-01-21 11:16:07 +0000
commit7f992290a62cb70c8d7b1e5b3503303f4f059b7c (patch)
tree6c587e501106227809c87e0cc2587cfdc0de9ae5 /src
parent201957e436b9b41c415824e0b16e7b83979476a2 (diff)
downloadrabbitmq-server-git-7f992290a62cb70c8d7b1e5b3503303f4f059b7c.tar.gz
fixed²
Diffstat (limited to 'src')
-rw-r--r--src/file_handle_cache.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index 1b39d29697..45c0eff3db 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -735,11 +735,11 @@ process_obtains(State = #fhc_state { limit = Limit, count = Count })
process_obtains(State = #fhc_state { limit = Limit, count = Count,
obtains = Obtains }) ->
ObtainsLen = length(Obtains),
- Take = ObtainsLen - lists:min([ObtainsLen, Limit - Count]),
+ ObtainableLen = lists:min([ObtainsLen, Limit - Count]),
+ Take = ObtainsLen - ObtainableLen,
{ObtainsNew, ObtainableRev} = lists:split(Take, Obtains),
[gen_server:reply(From, ok) || From <- ObtainableRev],
- State #fhc_state { count = Count + length(ObtainableRev),
- obtains = ObtainsNew }.
+ State #fhc_state { count = Count + ObtainableLen, obtains = ObtainsNew }.
maybe_reduce(State = #fhc_state { limit = Limit, count = Count,
elders = Elders })