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:
parent
b40bb99a60
commit
5e2d95db97
@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user