i
timesassert "abc" * 4 == "abcabcabcabc"
assert "abc" * 1 == "abc"
assert "abc" * 0 == ""
var b = new Buffer
b.append("天地")
b = b * 4
assert b == "天地天地天地天地"
redef fun *(i) do
var mybtlen = _byte_length
var new_byte_length = mybtlen * i
var mylen = _length
var newlen = mylen * i
var its = _items
var fb = _first_byte
var ns = new CString(new_byte_length + 1)
ns[new_byte_length] = 0
var offset = 0
while i > 0 do
its.copy_to(ns, mybtlen, fb, offset)
offset += mybtlen
i -= 1
end
return new FlatString.full(ns, new_byte_length, 0, newlen)
end
lib/core/text/flat.nit:619,2--635,4