diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-05-27 11:56:04 +0100 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-05-27 11:56:04 +0100 |
commit | 3b1531d8a9fba96844e9b5de0763325344c0a14f (patch) | |
tree | 2f8d67c3cdb378f119f7c1cea429bae98524a069 | |
parent | e00ba55f2758ffc41e574bdde901b2508f792c9c (diff) | |
download | rabbitmq-server-3b1531d8a9fba96844e9b5de0763325344c0a14f.tar.gz |
Remove a terminal case it's not possible to hit, and make sure we wrap lim() everywhere we need it.
-rw-r--r-- | src/truncate.erl | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/truncate.erl b/src/truncate.erl index 8f53e362..685bdd7e 100644 --- a/src/truncate.erl +++ b/src/truncate.erl @@ -99,7 +99,6 @@ term_limit(Thing, Max) -> _ -> false end. -term_size(_, limit_exceeded) -> limit_exceeded; term_size(B, M) when is_bitstring(B) -> lim(M - size(B)); term_size(A, M) when is_atom(A) -> lim(M - 2); term_size(N, M) when is_number(N) -> lim(M - 2); @@ -114,7 +113,7 @@ term_size([H|T], M) -> limit_exceeded -> limit_exceeded; M2 -> case term_size(T, M2) of limit_exceeded -> limit_exceeded; - M3 -> M3 - 2 + M3 -> lim(M3 - 2) end end. |