From a3102175c5dcccce48406fde4443f0e54c3a1299 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 16 May 2023 18:16:20 -0700 Subject: [PATCH] get rid of unnecessary self dereference in RCTDevLoadingView (#37455) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37455 Changelog: [Internal] these are not needed Reviewed By: sammy-SC Differential Revision: D45757478 fbshipit-source-id: b7c228639ade40cbfcf638ac3abd858476b47bbf --- .../React/CoreModules/RCTDevLoadingView.mm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 8ea5edb281225e..02bdb96e1d507c 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -64,15 +64,15 @@ + (BOOL)requiresMainQueueSetup - (void)clearInitialMessageDelay { - if (self->_initialMessageBlock != nil) { - dispatch_block_cancel(self->_initialMessageBlock); - self->_initialMessageBlock = nil; + if (_initialMessageBlock != nil) { + dispatch_block_cancel(_initialMessageBlock); + _initialMessageBlock = nil; } } - (void)showInitialMessageDelayed:(void (^)())initialMessage { - self->_initialMessageBlock = dispatch_block_create(static_cast(0), initialMessage); + _initialMessageBlock = dispatch_block_create(static_cast(0), initialMessage); // We delay the initial loading message to prevent flashing it // when loading progress starts quickly. To do that, we @@ -85,7 +85,7 @@ - (void)showInitialMessageDelayed:(void (^)())initialMessage - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor { - if (!RCTDevLoadingViewGetEnabled() || self->_hiding) { + if (!RCTDevLoadingViewGetEnabled() || _hiding) { return; } @@ -152,7 +152,7 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( [self clearInitialMessageDelay]; dispatch_async(dispatch_get_main_queue(), ^{ - self->_hiding = true; + self->_hiding = YES; const NSTimeInterval MIN_PRESENTED_TIME = 0.6; NSTimeInterval presentedTime = [[NSDate date] timeIntervalSinceDate:self->_showDate]; NSTimeInterval delay = MAX(0, MIN_PRESENTED_TIME - presentedTime); @@ -174,11 +174,11 @@ - (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:( - (void)showProgressMessage:(NSString *)message { - if (self->_window != nil) { + if (_window != nil) { // This is an optimization. Since the progress can come in quickly, // we want to do the minimum amount of work to update the UI, // which is to only update the label text. - self->_label.text = message; + _label.text = message; return; }