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>
bb10
Edward Welbourne 2024-04-10 16:13:37 +02:00
parent fcf5253ce8
commit 9d242afbd0
2 changed files with 2 additions and 2 deletions

View File

@ -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; }
};

View File

@ -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); }
};