json/static: Replaced uses of write_to_string by to_s since it benefits from copy...
authorLucas Bajolet <r4pass@hotmail.com>
Fri, 30 Oct 2015 15:24:24 +0000 (11:24 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Fri, 6 Nov 2015 21:33:42 +0000 (16:33 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/json/static.nit

index 9d581f3..6f2a9e4 100644 (file)
@@ -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