summaryrefslogtreecommitdiffstats
path: root/src/corelib/time
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2024-04-10 16:13:37 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2024-04-19 13:56:36 +0200
commit9d242afbd01bef6f5f0455100dc8299980ae08ca (patch)
tree9739f5f18c15a6aeaf7e4793965bb76d161231af /src/corelib/time
parentfcf5253ce8b808fc867a26962362335ce6f5091f (diff)
QDateTime, QTimeZone: pass ShortData by value to comparison
The internal ShortData types are trivially copyable. Although their operator==()s are defined in the bodies of public API classes, they are inline and act on private member classes, so the change (technically) to a public API class should be invisible to client code, hence both source and binary compatible. Task-number: QTBUG-122619 Change-Id: I854474c02da6607e7e81aa9161ce5b5aae659f00 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/time')
-rw-r--r--src/corelib/time/qdatetime.h2
-rw-r--r--src/corelib/time/qtimezone.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h
index f8a9360fbb..e1c0d29e2a 100644
--- a/src/corelib/time/qdatetime.h
+++ b/src/corelib/time/qdatetime.h
@@ -302,7 +302,7 @@ class Q_CORE_EXPORT QDateTime
quintptr status : 8;
# endif
#endif
- friend constexpr bool operator==(const ShortData &lhs, const ShortData &rhs)
+ friend constexpr bool operator==(ShortData lhs, ShortData rhs)
{ return lhs.status == rhs.status && lhs.msecs == rhs.msecs; }
};
diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h
index fc53a74453..46c7d6312b 100644
--- a/src/corelib/time/qtimezone.h
+++ b/src/corelib/time/qtimezone.h
@@ -49,7 +49,7 @@ class Q_CORE_EXPORT QTimeZone
#endif
{
}
- friend constexpr bool operator==(const ShortData &lhs, const ShortData &rhs)
+ friend constexpr bool operator==(ShortData lhs, ShortData rhs)
{ return lhs.mode == rhs.mode && lhs.offset == rhs.offset; }
constexpr Qt::TimeSpec spec() const { return Qt::TimeSpec((mode + 3) & 3); }
};