mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 19:05:31 +08:00
Swap comparison order in case the value expensive to compare.
This commit is contained in:
@@ -703,7 +703,7 @@ namespace BlackMisc
|
|||||||
Q_ASSERT(QThread::currentThread() == thread());
|
Q_ASSERT(QThread::currentThread() == thread());
|
||||||
|
|
||||||
if (timestamp == 0) { timestamp = QDateTime::currentMSecsSinceEpoch(); }
|
if (timestamp == 0) { timestamp = QDateTime::currentMSecsSinceEpoch(); }
|
||||||
bool changed = element.m_value.read() != value || element.m_timestamp != timestamp;
|
bool changed = element.m_timestamp != timestamp || element.m_value.read() != value;
|
||||||
if (! changed && ! save && ! ignoreValue) { return {}; }
|
if (! changed && ! save && ! ignoreValue) { return {}; }
|
||||||
|
|
||||||
if (ignoreValue) { value = element.m_value.read(); }
|
if (ignoreValue) { value = element.m_value.read(); }
|
||||||
|
|||||||
Reference in New Issue
Block a user