mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
Simplify comparison
From https://doc.qt.io/qt-5/qdatetime.html#operator-eq-eq: >Since 5.14, all invalid datetimes are equal to one another and differ from all other datetimes.
This commit is contained in:
parent
c382191e75
commit
e96f2d7be0
1 changed files with 1 additions and 3 deletions
|
@ -51,10 +51,8 @@ namespace
|
||||||
const bool isLeftValid = left.isValid();
|
const bool isLeftValid = left.isValid();
|
||||||
const bool isRightValid = right.isValid();
|
const bool isRightValid = right.isValid();
|
||||||
|
|
||||||
if (isLeftValid && isRightValid)
|
if (isLeftValid == isRightValid)
|
||||||
return threeWayCompare(left, right);
|
return threeWayCompare(left, right);
|
||||||
if (!isLeftValid && !isRightValid)
|
|
||||||
return 0;
|
|
||||||
return isLeftValid ? -1 : 1;
|
return isLeftValid ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue