Simplify code, remove redundant condition
'clazz || (!clazz && isCached)' is equivalent to 'clazz || isCached' Done-with: Tang Peng <tangpeng@uniontech.com> Pick-to: 6.1 Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
c1c61c3bb4
commit
a913002f13
@ -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