summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@lshift.net>2010-01-27 13:00:30 +0000
committerMatthias Radestock <matthias@lshift.net>2010-01-27 13:00:30 +0000
commitd57cbe5283dff29a0eccc19f72bde86e2f26c20e (patch)
tree7291d11a8c93c0d9b44bf0c45eaecad4bc39edb3
parent40f3c9c8d24cb23230870ef32ca8087f55dbab2a (diff)
downloadrabbitmq-server-d57cbe5283dff29a0eccc19f72bde86e2f26c20e.tar.gz
fix embarrassing arithmetic bug in 'ceil'
0.0 doesn't case-match 0, but 0 == 0.0
-rw-r--r--src/rabbit_misc.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl
index 0866da3f..172e27f4 100644
--- a/src/rabbit_misc.erl
+++ b/src/rabbit_misc.erl
@@ -489,9 +489,9 @@ unfold(Fun, Acc, Init) ->
ceil(N) ->
T = trunc(N),
- case N - T of
- 0 -> N;
- _ -> 1 + T
+ case N == T of
+ true -> T;
+ false -> 1 + T
end.
queue_fold(Fun, Init, Q) ->