core :: Buffer :: append_substring_impl
# Unsafe version of `append_substring` for performance
#
# NOTE: Use only if sure about `from` and `length`, no checks
# or bound recalculation is done
fun append_substring_impl(s: Text, from, length: Int) do
var max = from + length
for i in [from .. max[ do add s[i]
end
lib/core/text/abstract_text.nit:1714,2--1721,4
redef fun append_substring_impl(s, from, length) do
if length <= 0 then return
if not s isa FlatText then
super
return
end
var sits = s._items
var bytest = s.char_to_byte_index(from)
var bytend = s.char_to_byte_index(from + length - 1)
var btln = bytend - bytest + sits.char_at(bytend).u8char_len
enlarge(btln + _byte_length)
sits.copy_to(_items, btln, bytest, _byte_length)
_byte_length += btln
_length += length
end
lib/core/text/flat.nit:1106,2--1120,4