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:
parent
d12df462c3
commit
bb1070e17a
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user