mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Simplify hasNativeModule boolean ternary (#55490)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55490 Changelog: [Internal] Simplified a redundant boolean ternary expression in CatalystInstanceImpl.hasNativeModule(). The expression `condition ? true : fallback` is equivalent to `condition || fallback`. This change improves code readability without changing behavior. Reviewed By: cortinico Differential Revision: D92836584 fbshipit-source-id: 2946c779e73c06554e04c1df75ddccc5f9d048ff
This commit is contained in:
1 parent
cb2453145d
commit
da1ef0d925
1 file changed
+2
-3
+2
-3
@@ -416,9 +416,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
@Override
|
||||
public <T extends NativeModule> boolean hasNativeModule(Class<T> nativeModuleInterface) {
|
||||
String moduleName = getNameFromAnnotation(nativeModuleInterface);
|
||||
return getTurboModuleRegistry() != null && getTurboModuleRegistry().hasModule(moduleName)
|
||||
? true
|
||||
: mNativeModuleRegistry.hasModule(moduleName);
|
||||
return (getTurboModuleRegistry() != null && getTurboModuleRegistry().hasModule(moduleName))
|
||||
|| mNativeModuleRegistry.hasModule(moduleName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user