From f8d6adb90c8a809203252b04984f43bddad74e76 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Thu, 5 May 2016 11:05:42 -0400 Subject: [PATCH] lib/core: Fix `new FlatBuffer.from` Signed-off-by: Lucas Bajolet --- lib/core/text/flat.nit | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/core/text/flat.nit b/lib/core/text/flat.nit index 45ad144..9f5659a 100644 --- a/lib/core/text/flat.nit +++ b/lib/core/text/flat.nit @@ -991,15 +991,10 @@ class FlatBuffer init from(s: Text) do _items = new NativeString(s.bytelen) - if s isa FlatText then - _items = s._items - else - for i in substrings do i.as(FlatString)._items.copy_to(_items, i._bytelen, 0, 0) - end + for i in s.substrings do i._items.copy_to(_items, i._bytelen, first_byte, 0) _bytelen = s.bytelen _length = s.length _capacity = _bytelen - written = true end # Create a new empty string with a given capacity. -- 1.7.9.5