Simplify code, remove redundant condition

'clazz || (!clazz && isCached)' is equivalent to
'clazz || isCached'

Done-with: Tang Peng <tangpeng@uniontech.com>
Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a913002f13d8a2faad512ffda6c70f413b8e7ee5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Wang Yicun 2021-03-04 17:19:55 +08:00 committed by Qt Cherry-pick Bot
parent d12df462c3
commit bb1070e17a
2 changed files with 2 additions and 6 deletions

View File

@ -280,9 +280,7 @@ jclass QJNIEnvironmentPrivate::findClass(const char *className, JNIEnv *env)
bool isCached = false;
jclass clazz = getCachedClass(classDotEnc, &isCached);
const bool found = (clazz != 0) || (clazz == 0 && isCached);
if (found)
if (clazz || isCached)
return clazz;
const QLatin1String key(classDotEnc);

View File

@ -467,9 +467,7 @@ jclass QtAndroidPrivate::findClass(const char *className, JNIEnv *env)
bool isCached = false;
jclass clazz = getCachedClass(classDotEnc, &isCached);
const bool found = clazz || (!clazz && isCached);
if (found)
if (clazz || isCached)
return clazz;
const QLatin1String key(classDotEnc);