remove redundant QHostInfoCache member

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-03-30 10:12:20 +02:00
parent 9e09132f46
commit 067589df09
2 changed files with 3 additions and 5 deletions

View file

@ -240,9 +240,8 @@ void Q_AUTOTEST_EXPORT qt_qhostinfo_enable_cache(bool e)
}
}
// cache for 60 seconds
// cache 128 items
QHostInfoCache::QHostInfoCache() : max_age(60), enabled(true), cache(128)
// caches 128 items for for 60 seconds
QHostInfoCache::QHostInfoCache() : enabled(true), cache(128)
{
#ifdef QT_QHOSTINFO_CACHE_DISABLED_BY_DEFAULT
enabled = false;
@ -266,7 +265,7 @@ QHostInfo QHostInfoCache::get(const QString &name, bool *valid) const
{
*valid = false;
QHostInfoCacheElement *element = cache.object(name);
if (element && element->age.elapsed() < max_age*1000) {
if (element && element->age.elapsed() < 60000) {
*valid = true;
return element->info;
}

View file

@ -71,7 +71,6 @@ class QHostInfoCache
{
public:
QHostInfoCache();
const int max_age; // seconds
QHostInfo get(const QString &name, bool *valid) const;
void put(const QString &name, const QHostInfo &info);