Fix inserting before/after a range into the string
This commit is contained in:
parent
d30de300d6
commit
5ae20512af
@ -1564,10 +1564,12 @@ struct String
|
|||||||
}
|
}
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
auto oldLen = this.data + length;
|
const oldLength = length;
|
||||||
|
const rangeEnd = r.end - this.data;
|
||||||
const inserted = insertBack(el);
|
const inserted = insertBack(el);
|
||||||
bringToFront(ByCodeUnit!char(this, r.end, oldLen),
|
auto containerEnd = this.data + oldLength;
|
||||||
ByCodeUnit!char(this, oldLen, this.data + length));
|
bringToFront(ByCodeUnit!char(this, this.data + rangeEnd, containerEnd),
|
||||||
|
ByCodeUnit!char(this, containerEnd, this.data + length));
|
||||||
return inserted;
|
return inserted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user