diff options
author | Aleix Pol <aleixpol@kde.org> | 2021-07-05 00:41:51 +0200 |
---|---|---|
committer | Aleix Pol <aleixpol@kde.org> | 2021-07-05 15:51:02 +0200 |
commit | 3c78617ac60dd8da2434fcbb7f61bd62d19492a7 (patch) | |
tree | 10696b32d28309b41f217bd8f42d6706ee904d78 /src | |
parent | e74f28482253890d1c7e74fa51f087cc3310ce60 (diff) | |
download | kconfig-3c78617ac60dd8da2434fcbb7f61bd62d19492a7.tar.gz kconfig-3c78617ac60dd8da2434fcbb7f61bd62d19492a7.tar.bz2 |
Do not create a vector and a QByteArray just to discard it immediately
Diffstat (limited to 'src')
-rw-r--r-- | src/core/kconfigini.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index fc6f34ec..a67e490f 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -90,7 +90,9 @@ KConfigBackend::ParseInfo KConfigIniBackend::parseConfig(const QByteArray &curre BufferFragment contents(buffer.data(), buffer.size()); unsigned int len = contents.length(); unsigned int startOfLine = 0; - const QByteArray currentLanguage = currentLocale.split('_').first(); + + const int langIdx = currentLocale.indexOf('_'); + const QByteArray currentLanguage = langIdx >= 0 ? currentLocale.left(langIdx) : currentLocale; QByteArray currentGroup("<default>"); bool bDefault = options & ParseDefaults; |