Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -278,8 +280,9 @@ - (void)displayDidRefresh:(CADisplayLink *)displayLink
- (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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ - (void)didMoveToWindow

- (void)beginRefreshingProgrammatically
{
if (!_hasMovedToWindow)
if (!_hasMovedToWindow) {
return;
}

UInt64 beginRefreshingTimestamp = _currentRefreshingStateTimestamp;
_refreshingProgrammatically = YES;
Expand Down Expand Up @@ -108,8 +109,9 @@ - (void)beginRefreshingProgrammatically

- (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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
Loading