summaryrefslogtreecommitdiffstats
path: root/src/corelib/time/qtimezoneprivate_tz.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-05-23 16:01:43 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-06-08 18:41:01 +0200
commit02b11e0623ed795061a84602aaa1dc54b6460d72 (patch)
treec58bde684c1ec22a65d24f8458955d0b9c7413eb /src/corelib/time/qtimezoneprivate_tz.cpp
parent0a350eaf25f84d306ffd191f5205b67197ce1375 (diff)
PosixZone::parse(): don't reset already-initialized variable
The nameBegin variable was already initialized to pos, so just increment it in the one case that needs it rather than resetting it in both branches of the condition. Change-Id: Ia0d42b604ed21829dc84c27a1907c345f62594d1 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/time/qtimezoneprivate_tz.cpp')
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 360f6636ed..627a4a8165 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -483,7 +483,7 @@ PosixZone PosixZone::parse(const char *&pos, const char *end)
Q_ASSERT(pos < end);
if (*pos == '<') {
- nameBegin = pos + 1; // skip the '<'
+ ++nameBegin; // skip the '<'
nameEnd = nameBegin;
while (nameEnd < end && *nameEnd != '>') {
// POSIX says only alphanumeric, but we allow anything
@@ -491,7 +491,6 @@ PosixZone PosixZone::parse(const char *&pos, const char *end)
}
pos = nameEnd + 1; // skip the '>'
} else {
- nameBegin = pos;
nameEnd = nameBegin;
while (nameEnd < end && asciiIsLetter(*nameEnd))
++nameEnd;