Commit b80f7a0d authored by Eric Jiang's avatar Eric Jiang Committed by Julius Künzel
Browse files

Simplify confusing logic in ThumbnailCache::getKey()

Checking `if (ok)` is always true because `ok` was dereferenced right
above so we know the pointer is not null.
parent e5309de6
Pipeline #210526 passed with stage
in 6 minutes and 34 seconds
......@@ -330,11 +330,10 @@ QString ThumbnailCache::getKey(const QString &binId, int pos, bool *ok)
}
auto binClip = pCore->projectItemModel()->getClipByBinID(binId);
*ok = binClip != nullptr && binClip->statusReady();
QString result;
if (!ok) {
return result;
if (!*ok) {
return QString();
}
return *ok ? binClip->hashForThumbs() + QLatin1Char('#') + QString::number(pos) + QStringLiteral(".jpg") : QString();
return binClip->hashForThumbs() + QLatin1Char('#') + QString::number(pos) + QStringLiteral(".jpg");
}
// static
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment