mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix CQS signal readability-braces-around-statements in xplat/js/react-native-github/packages
Reviewed By: cipolleschi Differential Revision: D78549834
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3f9b19eb89
commit
beeec9929b
@@ -50,8 +50,9 @@ class LazyVector {
|
||||
|
||||
const_reference at(size_type pos) const {
|
||||
#ifndef _LIBCPP_NO_EXCEPTIONS
|
||||
if (!(pos < _size))
|
||||
if (!(pos < _size)) {
|
||||
throw std::out_of_range("out of range");
|
||||
}
|
||||
#else
|
||||
assert(pos < _size || !"out of range");
|
||||
#endif
|
||||
|
||||
@@ -25,11 +25,13 @@ static NSUInteger RCTDeviceFreeMemory(void)
|
||||
kern_return_t kern;
|
||||
|
||||
kern = host_page_size(host_port, &page_size);
|
||||
if (kern != KERN_SUCCESS)
|
||||
if (kern != KERN_SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
kern = host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size);
|
||||
if (kern != KERN_SUCCESS)
|
||||
if (kern != KERN_SUCCESS) {
|
||||
return 0;
|
||||
}
|
||||
return (vm_stat.free_count - vm_stat.speculative_count) * page_size;
|
||||
}
|
||||
|
||||
@@ -278,8 +280,9 @@ static NSUInteger RCTDeviceFreeMemory(void)
|
||||
- (void)calculateMaxBufferCount
|
||||
{
|
||||
NSUInteger bytes = CGImageGetBytesPerRow(self.currentFrame.CGImage) * CGImageGetHeight(self.currentFrame.CGImage);
|
||||
if (bytes == 0)
|
||||
if (bytes == 0) {
|
||||
bytes = 1024;
|
||||
}
|
||||
|
||||
NSUInteger max = 0;
|
||||
if (self.maxBufferSize > 0) {
|
||||
|
||||
@@ -71,8 +71,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
|
||||
- (void)beginRefreshingProgrammatically
|
||||
{
|
||||
if (!_hasMovedToWindow)
|
||||
if (!_hasMovedToWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp;
|
||||
_refreshingProgrammatically = YES;
|
||||
@@ -108,8 +109,9 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
||||
|
||||
- (void)endRefreshingProgrammatically
|
||||
{
|
||||
if (!_hasMovedToWindow)
|
||||
if (!_hasMovedToWindow) {
|
||||
return;
|
||||
}
|
||||
// The contentOffset of the scrollview MUST be greater than the contentInset before calling
|
||||
// endRefreshing otherwise the next pull to refresh will not work properly.
|
||||
UIScrollView *scrollView = self.scrollView;
|
||||
|
||||
@@ -16,8 +16,9 @@ using namespace facebook::react;
|
||||
namespace {
|
||||
int tempFileFromString(std::string contents) {
|
||||
const char* tmpDir = getenv("TMPDIR");
|
||||
if (tmpDir == nullptr)
|
||||
if (tmpDir == nullptr) {
|
||||
tmpDir = "/tmp";
|
||||
}
|
||||
std::string tmp{tmpDir};
|
||||
tmp += "/temp.XXXXXX";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user