From 0a350eaf25f84d306ffd191f5205b67197ce1375 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 23 May 2022 15:59:35 +0200 Subject: [PATCH] Drop const from a declaration to let a return move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- src/corelib/time/qtimezone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/time/qtimezone.cpp b/src/corelib/time/qtimezone.cpp index 92c7899ac9f..3b357cb4555 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: