From bbf604d11d707f10337cab5b955388e95c180805 Mon Sep 17 00:00:00 2001 From: Niklas Kurkisuo Date: Thu, 6 Jan 2011 10:39:14 +0200 Subject: QHostInfoCache: Use QElapsedTime instead of QTime Use QElapsedTime instead of QTime for performance gain. See QT-2965 for more info. Task-number: QTBUG-16468 Reviewed-by: Markus Goetz --- src/network/kernel/qhostinfo.cpp | 2 +- src/network/kernel/qhostinfo_p.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index c8fc45e..0c734d5 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -720,7 +720,7 @@ void QHostInfoCache::put(const QString &name, const QHostInfo &info) QHostInfoCacheElement* element = new QHostInfoCacheElement(); element->info = info; - element->age = QTime(); + element->age = QElapsedTimer(); element->age.start(); QMutexLocker locker(&this->mutex); diff --git a/src/network/kernel/qhostinfo_p.h b/src/network/kernel/qhostinfo_p.h index 134335f..80d8e14 100644 --- a/src/network/kernel/qhostinfo_p.h +++ b/src/network/kernel/qhostinfo_p.h @@ -66,7 +66,7 @@ #include "QtCore/qrunnable.h" #include "QtCore/qlist.h" #include "QtCore/qqueue.h" -#include +#include #include @@ -132,7 +132,7 @@ private: bool enabled; struct QHostInfoCacheElement { QHostInfo info; - QTime age; + QElapsedTimer age; }; QCache cache; QMutex mutex; -- cgit v0.12