QTextCursor: use QSV more
to avoid needless allocations Change-Id: I081119f3ee08a1cc6ec16745518c2ed75042dbf2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
079d0cb5c0
commit
27a3d3ac90
@ -1679,7 +1679,7 @@ static void getText(QString &text, QTextDocumentPrivate *priv, const QString &do
|
|||||||
const int offsetInFragment = qMax(0, pos - fragIt.position());
|
const int offsetInFragment = qMax(0, pos - fragIt.position());
|
||||||
const int len = qMin(int(frag->size_array[0] - offsetInFragment), end - pos);
|
const int len = qMin(int(frag->size_array[0] - offsetInFragment), end - pos);
|
||||||
|
|
||||||
text += QString(docText.constData() + frag->stringPosition + offsetInFragment, len);
|
text += QStringView(docText.constData() + frag->stringPosition + offsetInFragment, len);
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user