mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 21:46:03 +03:00
Compare QDateTime objects more efficient
There is no need to call toMSecsSinceEpoch() as QDateTime implements an comparison operator itself. This is more efficient, because the QDateTime comparison operator doesn't call localtime() in all cases. Thus, we don't read /etc/localtime for every comparison. This improves performance in some cases. Signed-off-by: David Kahles <david.kahles96@gmail.com>
This commit is contained in:
parent
30829d0669
commit
9a3aa55b29
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ namespace OCC {
|
|||
|
||||
bool operator<(const Activity &rhs, const Activity &lhs)
|
||||
{
|
||||
return rhs._dateTime.toMSecsSinceEpoch() > lhs._dateTime.toMSecsSinceEpoch();
|
||||
return rhs._dateTime > lhs._dateTime;
|
||||
}
|
||||
|
||||
bool operator==(const Activity &rhs, const Activity &lhs)
|
||||
|
|
Loading…
Reference in a new issue