Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages

Reviewed By: rshest

Differential Revision: D81569365
This commit is contained in:
CodemodService Bot
2025-09-04 01:58:43 -07:00
committed by Facebook GitHub Bot
parent 5d65794ee4
commit 14ecdcfdd4
3 changed files with 5 additions and 5 deletions
@@ -132,18 +132,18 @@ static Class<RCTComponentViewProtocol> RCTComponentViewClassWithName(const char
// Fallback 1: Call provider function for component view class.
Class<RCTComponentViewProtocol> klass = RCTComponentViewClassWithName(name.c_str());
if (klass) {
if (klass != nullptr) {
[self registerComponentViewClass:klass];
return;
}
// Fallback 2: Ask the provider and check in the dictionary provided
if (self.thirdPartyFabricComponentsProvider) {
if (self.thirdPartyFabricComponentsProvider != nullptr) {
// Test whether a provider has been passed to avoid potentially expensive conversions
// between C++ and ObjC strings.
NSString *objcName = [NSString stringWithCString:name.c_str() encoding:NSUTF8StringEncoding];
klass = self.thirdPartyFabricComponentsProvider.thirdPartyFabricComponents[objcName];
if (klass) {
if (klass != nullptr) {
[self registerComponentViewClass:klass];
return;
}
@@ -54,7 +54,7 @@ PlatformRunLoopObserver::PlatformRunLoopObserver(
mainRunLoopObserver_ = CFRunLoopObserverCreateWithHandler(
NULL /* allocator */,
toCFRunLoopActivity(activities_) /* activities */,
true /* repeats */,
1u /* repeats */,
0 /* order */,
^(CFRunLoopObserverRef observer, CFRunLoopActivity activity) {
auto strongOwner = owner.lock();
@@ -50,7 +50,7 @@ static CGRect insetRect(CGRect rect, CGFloat left, CGFloat top, CGFloat right, C
static CGColorRef colorRefFromSharedColor(const SharedColor &color)
{
CGColorRef colorRef = RCTUIColorFromSharedColor(color).CGColor;
return colorRef ? colorRef : [UIColor blackColor].CGColor;
return (colorRef != nullptr) ? colorRef : [UIColor blackColor].CGColor;
}
static CALayer *initBoxShadowLayer(const BoxShadow &shadow, CGSize layerSize)