diff options
author | David Faure <david.faure@kdab.com> | 2019-12-02 21:16:24 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2019-12-05 14:06:02 +0100 |
commit | aa504fc2fa764b44d37d9629b9ddf1f114210759 (patch) | |
tree | 20b70546ad8b7e272608c3456241a793c4a0ca39 /src/plugins/platforms/xcb/qxcbscreen.cpp | |
parent | 97ac281c1d70dcfbb137e5a83e24a747e9510116 (diff) |
Optimize qLastIndexOf<QString> to not detach the QString
The call to data() on a non-const QString led to a detach(), which is
unexpected and unwanted from QString::lastIndexOf() const.
Found by looking at why QFileSystemEntry::fileName() was expensive, in
the hotspot profiler.
The solution is to instanciate QLastIndexOf with QStringView() rather
than QString(). I added a deleted QString overload to make sure nobody
ever instanciates it with a QString argument again.
Change-Id: I06a1b2f937425e83f0779eb215e099aef78c50a7
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbscreen.cpp')
0 files changed, 0 insertions, 0 deletions