Use new QBA::assign in QCoreApplication::applicationFilePath()

QByteArray::assign() re-uses existing unshared capacity(), if any, and
is therefore potentially more efficient than '= QByteArray(~)' (and
never slower).

Task-number: QTBUG-106201
Pick-to: 6.6
Change-Id: Ieeb254afd94e26f1b425795feb53c59ebb2322c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Dennis Oberst 2023-07-31 14:40:19 +02:00
parent b40bb99a60
commit 5e2d95db97

View File

@ -2478,7 +2478,7 @@ QString QCoreApplication::applicationFilePath()
if (procName != d->argv[0]) {
// clear the cache if the procname changes, so we reprocess it.
QCoreApplicationPrivate::clearApplicationFilePath();
procName = QByteArray(d->argv[0]);
procName.assign(d->argv[0]);
}
}