diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-01 11:06:47 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-06 16:28:57 +0200 |
commit | 2ac45198cf101f094cf8d94f3a546a57624e59f5 (patch) | |
tree | d833a07af98f3897945706e84c50c0c92d7f5f66 /src/core/kconfigini.cpp | |
parent | 081f559031fed7cde755e006b226cf06f33bd0f8 (diff) | |
download | kconfig-2ac45198cf101f094cf8d94f3a546a57624e59f5.tar.gz kconfig-2ac45198cf101f094cf8d94f3a546a57624e59f5.tar.bz2 |
Preincerment/predecrement operator where the post ones aren't needed
NO_CHANGELOG
Diffstat (limited to 'src/core/kconfigini.cpp')
-rw-r--r-- | src/core/kconfigini.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/kconfigini.cpp b/src/core/kconfigini.cpp index b5f40373..96cd3763 100644 --- a/src/core/kconfigini.cpp +++ b/src/core/kconfigini.cpp @@ -111,7 +111,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry while (startOfLine < len) { BufferFragment line = contents.split('\n', &startOfLine); line.trim(); - lineNo++; + ++lineNo; // skip empty lines and lines beginning with '#' if (line.isEmpty() || line.at(0) == '#') { @@ -122,7 +122,8 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry groupOptionImmutable = fileOptionImmutable; QByteArray newGroup; - int start = 1, end; + int start = 1; + int end = 0; do { end = start; for (;;) { @@ -134,7 +135,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry if (line.at(end) == ']') { break; } - end++; + ++end; } if (end + 1 == line.length() && start + 2 == end && line.at(start) == '$' && line.at(start + 1) == 'i') { @@ -224,7 +225,7 @@ KConfigIniBackend::parseConfig(const QByteArray ¤tLocale, KEntryMap &entry default: break; } - i++; + ++i; } } else { // found a locale if (!locale.isNull()) { @@ -333,7 +334,7 @@ void KConfigIniBackend::writeEntries(const QByteArray &locale, QIODevice &file, } } file.write("\\x24"); - start++; + ++start; } nope: file.write(stringToPrintable(currentGroup.mid(start), GroupString)); @@ -758,7 +759,7 @@ QByteArray KConfigIniBackend::stringToPrintable(const QByteArray &aString, Strin if (s[0] == ' ' && type != GroupString) { *data++ = '\\'; *data++ = 's'; - i++; + ++i; } Utf8Char utf8; @@ -869,7 +870,7 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile & *r = str[i]; } else { // Probable escape sequence - i++; + ++i; if (i >= l) { // Line ends after backslash - stop. *r = '\\'; break; @@ -894,13 +895,13 @@ void KConfigIniBackend::printableToString(BufferFragment *aString, const QFile & case ';': // not really an escape sequence, but allowed in .desktop files, don't strip '\;' from the string *r = '\\'; - r++; + ++r; *r = ';'; break; case ',': // not really an escape sequence, but allowed in .desktop files, don't strip '\,' from the string *r = '\\'; - r++; + ++r; *r = ','; break; case 'x': |