From c5a375161445e713a8d28864d59d9bdafc3ea7f0 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 30 Oct 2015 11:24:24 -0400 Subject: [PATCH] json/static: Replaced uses of write_to_string by to_s since it benefits from copy-on-write mechanisms Signed-off-by: Lucas Bajolet --- lib/json/static.nit | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/json/static.nit b/lib/json/static.nit index 9d581f3..6f2a9e4 100644 --- a/lib/json/static.nit +++ b/lib/json/static.nit @@ -49,7 +49,7 @@ interface Jsonable protected fun to_json_by_append: String do var buffer = new RopeBuffer append_json(buffer) - return buffer.write_to_string + return buffer.to_s end # Append the JSON representation of `self` to the specified buffer. @@ -80,7 +80,7 @@ interface Jsonable var res = new FlatBuffer pretty_json_visit(res, 0) res.add '\n' - return res.write_to_string + return res.to_s end private fun pretty_json_visit(buffer: FlatBuffer, indent: Int) is abstract @@ -467,7 +467,7 @@ redef class Nstring res.add char i += 1 end - return res.write_to_string + return res.to_s end end -- 1.7.9.5