summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2022-05-23 15:59:35 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2022-06-08 18:41:01 +0200
commit0a350eaf25f84d306ffd191f5205b67197ce1375 (patch)
treeeda9a1676393c63310e97e4f3d66e5042ea4517a
parentb6be97f65e139f636e6905cec76f074ce044d6a2 (diff)
Drop const from a declaration to let a return move
CodeChecker points out that QTimeZone::systemTimeZoneId()'s first attempt saved its result in a const QByteArray, which consequently wasn't moved from when returning. That doesn't make a huge difference for a CoW, but might as well skip the const and let the compiler do the natural thing. Change-Id: I966c9137505a8188532b164524dd4e05c0b2ac53 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>
-rw-r--r--src/corelib/time/qtimezone.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp
index 92c7899ac9..3b357cb455 100644
--- a/src/corelib/time/qtimezone.cpp
+++ b/src/corelib/time/qtimezone.cpp
@@ -762,7 +762,7 @@ QTimeZone::OffsetDataList QTimeZone::transitions(const QDateTime &fromDateTime,
QByteArray QTimeZone::systemTimeZoneId()
{
- const QByteArray sys = global_tz->backend->systemTimeZoneId();
+ QByteArray sys = global_tz->backend->systemTimeZoneId();
if (!sys.isEmpty())
return sys;
// The system zone, despite the empty ID, may know its real ID anyway: