lib/core: Perfize reset in `FlatBuffer`
authorLucas Bajolet <r4pass@hotmail.com>
Mon, 9 May 2016 19:11:27 +0000 (15:11 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Mon, 9 May 2016 19:26:24 +0000 (15:26 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/core/text/flat.nit

index 67ffacf..09dc9ad 100644 (file)
@@ -924,7 +924,10 @@ class FlatBuffer
                is_dirty = true
                _bytelen = 0
                _length = 0
-               if written then reset
+               if written then
+                       _capacity = 16
+                       reset
+               end
        end
 
        redef fun empty do return new Buffer