QString: remove unnecessary copy in replace()
When a copy is needed, replace_helper() takes care of that for us. Change-Id: I9e5c89cb70b2902c96062a9edaf77fedda6ddb2c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
cd21da3922
commit
7a4ce3cbcc
@ -2346,8 +2346,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs)
|
|||||||
*/
|
*/
|
||||||
QString &QString::replace(int pos, int len, const QString &after)
|
QString &QString::replace(int pos, int len, const QString &after)
|
||||||
{
|
{
|
||||||
QString copy = after;
|
return replace(pos, len, after.constData(), after.length());
|
||||||
return replace(pos, len, copy.constData(), copy.length());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user