lib/core: Stop allocating 1 byte more when initializing a `FlatBuffer` with capacity
authorLucas Bajolet <r4pass@hotmail.com>
Tue, 3 May 2016 03:27:28 +0000 (23:27 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Tue, 3 May 2016 03:27:28 +0000 (23:27 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/core/text/flat.nit

index c3a2fed..45ad144 100644 (file)
@@ -1006,7 +1006,7 @@ class FlatBuffer
        init with_capacity(cap: Int)
        do
                assert cap >= 0
-               _items = new NativeString(cap + 1)
+               _items = new NativeString(cap)
                capacity = cap
                _bytelen = 0
        end