Commit be94e009 authored by Marc Mutz's avatar Marc Mutz
Browse files

QFileDialog: optimize string handling in qt_tildeExpansion


- Instead of QString::split()-ing the path, just to inspect the
  first item in the list returned, simply find the location of
  the first separator and work with that.
  -> saves creating a QList, and its QString elements
  -> saves attempted detaches of that list when calling
     first()
- When extracting the user name, don't do it in a QString, do
  it in a QStringRef.
- When constructing the result, don't use QString::replace(),
  use QStringBuilder with a QStringRef into the original string.
- Eradicate the out parameter, it is easily calculated from the
  return value.
- Don't calculate userName on VXWORKS and INTEGRITY, where it
  is not used. Requires a different #ifdef sequence. Fixed
  preprocessor directives' indention as a drive-by.

Costs 84b in text size on optimized GCC 4.9 Linux AMD64 builds.

Change-Id: I61f1e8d558db7fb0c5c1170bdfd6f5ac1f1a9e62
Reviewed-by: default avatarOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
parent 024a52d0
No related merge requests found
Showing with 43 additions and 41 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment