Delete RCTComputeScreenScale

Summary:
This method is redundant. You could just call RCTScreenScale()

Changelog: [iOS][Removed] Delete RCTComputeScreenScale

Reviewed By: philIip

Differential Revision: D72258778

fbshipit-source-id: 0b469169efc4f2def85b2e6b736f3c4570e6b428
This commit is contained in:
Ramanpreet Nara
2025-04-01 19:49:45 -07:00
committed by Facebook GitHub Bot
parent 1c21ec21e7
commit 094876367f
2 changed files with 3 additions and 13 deletions
@@ -46,9 +46,6 @@ RCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block);
// Please do not use this unless you know what you're doing.
RCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block);
// Get screen scale, can be only used on main
RCT_EXTERN void RCTComputeScreenScale(void);
// Get screen metrics in a thread-safe way
RCT_EXTERN CGFloat RCTScreenScale(void);
RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
+3 -10
View File
@@ -317,18 +317,11 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp
}
}
static dispatch_once_t onceTokenScreenScale;
static CGFloat screenScale;
void RCTComputeScreenScale(void)
{
dispatch_once(&onceTokenScreenScale, ^{
screenScale = [UITraitCollection currentTraitCollection].displayScale;
});
}
CGFloat RCTScreenScale(void)
{
static dispatch_once_t onceTokenScreenScale;
static CGFloat screenScale;
RCTUnsafeExecuteOnMainQueueOnceSync(&onceTokenScreenScale, ^{
screenScale = [UITraitCollection currentTraitCollection].displayScale;
});