Avoid double QCache lookup in QOpenGLProgramBinaryCache

Change-Id: I4384a15f0b89e1f6d7f59bff1816fc2e6fc6adfe
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Laszlo Agocs 2019-08-16 11:39:20 +02:00 committed by Marc Mutz
parent e688e28ee5
commit c47f436175

View File

@ -264,10 +264,8 @@ public:
bool QOpenGLProgramBinaryCache::load(const QByteArray &cacheKey, uint programId)
{
QMutexLocker lock(&m_mutex);
if (m_memCache.contains(cacheKey)) {
const MemCacheEntry *e = m_memCache[cacheKey];
if (const MemCacheEntry *e = m_memCache.object(cacheKey))
return setProgramBinary(programId, e->format, e->blob.constData(), e->blob.size());
}
QByteArray buf;
const QString fn = cacheFileName(cacheKey);