summaryrefslogtreecommitdiff
path: root/lib/compiler/src/v3_kernel_pp.erl
diff options
context:
space:
mode:
authorHans Bolinder <hasse@erlang.org>2017-06-29 16:38:12 +0200
committerSiri Hansen <siri@erlang.org>2017-09-15 17:07:48 +0200
commita443d41a1b7951137021e35ce480fbdd896f5cbc (patch)
tree43c78ff5e587fbd1650815e24af31ca50dc72706 /lib/compiler/src/v3_kernel_pp.erl
parent15abdca7ef9c6fb7812f13829346db59173e5681 (diff)
downloaderlang-a443d41a1b7951137021e35ce480fbdd896f5cbc.tar.gz
compiler: Do not use deprecated functions in string(3)
Diffstat (limited to 'lib/compiler/src/v3_kernel_pp.erl')
-rw-r--r--lib/compiler/src/v3_kernel_pp.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/compiler/src/v3_kernel_pp.erl b/lib/compiler/src/v3_kernel_pp.erl
index 53097d0d7d..ac91039ae0 100644
--- a/lib/compiler/src/v3_kernel_pp.erl
+++ b/lib/compiler/src/v3_kernel_pp.erl
@@ -491,7 +491,7 @@ indent(Ctxt) -> indent(Ctxt#ctxt.indent, Ctxt).
indent(N, _Ctxt) when N =< 0 -> "";
indent(N, Ctxt) ->
T = Ctxt#ctxt.tab_width,
- string:chars($\t, N div T, string:chars($\s, N rem T)).
+ lists:duplicate(N div T, $\t) ++ lists:duplicate(N rem T, $\s).
nl_indent(Ctxt) -> [$\n|indent(Ctxt)].
@@ -508,7 +508,7 @@ unindent([$\t|T], N, Ctxt, C) ->
if N >= Tab ->
unindent(T, N - Tab, Ctxt, C);
true ->
- unindent([string:chars($\s, Tab - N)|T], 0, Ctxt, C)
+ unindent([lists:duplicate(Tab - N, $\s)|T], 0, Ctxt, C)
end;
unindent([L|T], N, Ctxt, C) when is_list(L) ->
unindent(L, N, Ctxt, [T|C]);