diff options
| author | Aleix Pol <aleixpol@kde.org> | 2018-02-23 16:30:10 +0100 | 
|---|---|---|
| committer | Aleix Pol <aleixpol@kde.org> | 2018-02-24 00:26:42 +0100 | 
| commit | b435e3747d2d155dffac3bcbd870fc8b3d00438a (patch) | |
| tree | 9c4cb21cb9182b40dd7084ee700fa6e43ab43395 /src/core | |
| parent | 889c0a96bc65e210ee03f8385363a9b23d7d87c7 (diff) | |
| download | kconfig-b435e3747d2d155dffac3bcbd870fc8b3d00438a.tar.gz kconfig-b435e3747d2d155dffac3bcbd870fc8b3d00438a.tar.bz2 | |
Save some memory allocations by using the right API
Test Plan: tests pass
Reviewers: #frameworks, markg
Reviewed By: markg
Subscribers: markg
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D10771
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/kconfig.cpp | 6 | 
1 files changed, 3 insertions, 3 deletions
| diff --git a/src/core/kconfig.cpp b/src/core/kconfig.cpp index 4dab5e75..c8eb90af 100644 --- a/src/core/kconfig.cpp +++ b/src/core/kconfig.cpp @@ -200,13 +200,13 @@ QString KConfigPrivate::expandString(const QString &value)          } else if (aValue[nDollarPos + 1] != QLatin1Char('$')) {              int nEndPos = nDollarPos + 1;              // the next character is not $ -            QString aVarName; +            QStringRef aVarName;              if (aValue[nEndPos] == QLatin1Char('{')) {                  while ((nEndPos <= aValue.length()) && (aValue[nEndPos] != QLatin1Char('}'))) {                      nEndPos++;                  }                  nEndPos++; -                aVarName = aValue.mid(nDollarPos + 2, nEndPos - nDollarPos - 3); +                aVarName = aValue.midRef(nDollarPos + 2, nEndPos - nDollarPos - 3);              } else {                  while (nEndPos <= aValue.length() &&                          (aValue[nEndPos].isNumber() || @@ -214,7 +214,7 @@ QString KConfigPrivate::expandString(const QString &value)                           aValue[nEndPos] == QLatin1Char('_'))) {                      nEndPos++;                  } -                aVarName = aValue.mid(nDollarPos + 1, nEndPos - nDollarPos - 1); +                aVarName = aValue.midRef(nDollarPos + 1, nEndPos - nDollarPos - 1);              }              QString env;              if (!aVarName.isEmpty()) { | 
