Avoid double cache lookup in QHostInfoCache
Change-Id: If5ef2d2f117fe8c1abdf361f1122e32075e14385 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
0d4485fd78
commit
9e53325cfc
@ -724,8 +724,7 @@ QHostInfo QHostInfoCache::get(const QString &name, bool *valid)
|
||||
QMutexLocker locker(&this->mutex);
|
||||
|
||||
*valid = false;
|
||||
if (cache.contains(name)) {
|
||||
QHostInfoCacheElement *element = cache.object(name);
|
||||
if (QHostInfoCacheElement *element = cache.object(name)) {
|
||||
if (element->age.elapsed() < max_age*1000)
|
||||
*valid = true;
|
||||
return element->info;
|
||||
|
Loading…
Reference in New Issue
Block a user