diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2014-03-24 16:36:39 +0000 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2014-03-24 16:36:39 +0000 |
| commit | bb62b9ed85c3d2026e9233555ddac2c0e5b2749b (patch) | |
| tree | e2710f2d69e820250b4640bda2df6e663e0598ba /src/truncate.erl | |
| parent | 9fbe13b18ee33790d0b0610235b3cc26942060dc (diff) | |
| download | rabbitmq-server-git-bb62b9ed85c3d2026e9233555ddac2c0e5b2749b.tar.gz | |
tiny tidying
Diffstat (limited to 'src/truncate.erl')
| -rw-r--r-- | src/truncate.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/truncate.erl b/src/truncate.erl index a13764bfa2..5a7895993e 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) |
