From 2395d6cb72930fb15bec1ebb51aa1b419f4f756d Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Mon, 4 Feb 2013 23:30:28 -0800 Subject: [PATCH] replace handrolled binary copy with call to binary:copy --- src/jsx_to_json.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jsx_to_json.erl b/src/jsx_to_json.erl index 8e9bed3..7ddc13c 100644 --- a/src/jsx_to_json.erl +++ b/src/jsx_to_json.erl @@ -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.