summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-05-27 11:56:04 +0100
committerSimon MacMullen <simon@rabbitmq.com>2014-05-27 11:56:04 +0100
commit30887043d2636fbefbe79768eab7459af9d291b9 (patch)
tree2f8d67c3cdb378f119f7c1cea429bae98524a069 /src
parentb53642848b355fde102e3d9a8a79337ec61562c7 (diff)
downloadrabbitmq-server-git-30887043d2636fbefbe79768eab7459af9d291b9.tar.gz
Remove a terminal case it's not possible to hit, and make sure we wrap lim() everywhere we need it.
Diffstat (limited to 'src')
-rw-r--r--src/truncate.erl3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/truncate.erl b/src/truncate.erl
index 8f53e362c2..685bdd7e71 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.