summaryrefslogtreecommitdiff
path: root/src/truncate.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-03-24 16:36:39 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-03-24 16:36:39 +0000
commitccfe305107ec56ebca72eae44763feba7169f60f (patch)
treee2710f2d69e820250b4640bda2df6e663e0598ba /src/truncate.erl
parent5b7ee15f63f60ebfdeffaa72694976c9026c6d78 (diff)
downloadrabbitmq-server-ccfe305107ec56ebca72eae44763feba7169f60f.tar.gz
tiny tidying
Diffstat (limited to 'src/truncate.erl')
-rw-r--r--src/truncate.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/truncate.erl b/src/truncate.erl
index a13764bf..5a789599 100644
--- a/src/truncate.erl
+++ b/src/truncate.erl
@@ -46,10 +46,10 @@ term(Bin, N, _D) when is_binary(Bin) andalso size(Bin) > N - ?ELLIPSIS_LENGTH ->
<<Head:Suffix/binary, _/binary>> = Bin,
<<Head/binary, <<"...">>/binary>>;
term(L, N, D) when is_list(L) ->
- IsPrintable = io_lib:printable_list(L),
- case IsPrintable of
- true -> case length(L) > without_ellipsis(N) of
- true -> string:left(L, without_ellipsis(N)) ++ "...";
+ case io_lib:printable_list(L) of
+ true -> N2 = without_ellipsis(N),
+ case length(L) > N2 of
+ true -> string:left(L, N2) ++ "...";
false -> L
end;
false -> shrink_list(L, N, D)