replace handrolled binary copy with call to binary:copy

This commit is contained in:
alisdair sullivan 2013-02-04 23:30:28 -08:00
parent 5efec8af8e
commit 2395d6cb72

View file

@ -156,7 +156,7 @@ encode(float, Float, _Opts) ->
space(Opts) ->
case Opts#opts.space of
0 -> []
; X when X > 0 -> [ ?space || _ <- lists:seq(1, X) ]
; X when X > 0 -> binary:copy(?space, X)
end.
@ -164,7 +164,7 @@ indent(Opts) ->
case Opts#opts.indent of
0 -> []
; X when X > 0 ->
Indent = [ ?space || _ <- lists:seq(1, X) ],
Indent = binary:copy(?space, X),
indent(Indent, Opts#opts.depth, [?newline])
end.