Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code improvements #1622

Merged
merged 2 commits into from
Aug 21, 2019
Merged
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
2 changes: 1 addition & 1 deletion Source/ASExperimentalFeatures.mm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
ASExperimentalFeatures ASExperimentalFeaturesFromArray(NSArray<NSString *> *array)
{
NSArray *allNames = ASExperimentalFeaturesGetNames(ASExperimentalFeatureAll);
ASExperimentalFeatures result = 0;
ASExperimentalFeatures result = kNilOptions;
for (NSString *str in array) {
NSUInteger i = [allNames indexOfObject:str];
if (i != NSNotFound) {
Expand Down
2 changes: 1 addition & 1 deletion Source/ASImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ + (UIImage *)displayWithParameters:(id<NSObject>)parameter isCancelled:(NS_NOESC


// If we're not supposed to do any cropping, just decode image at original size
if (!cropEnabled || !contentModeSupported || stretchable) {
if (!cropEnabled || !contentModeSupported) {
backingSize = imageSizeInPixels;
imageDrawRect = (CGRect){.size = backingSize};
} else {
Expand Down
4 changes: 1 addition & 3 deletions Source/ASNetworkImageNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -555,9 +555,7 @@ - (void)_updateProgressImageBlockOnDownloaderIfNeeded
if (clearAndReattempt) {
// In this case another thread changed the _downloadIdentifierForProgressBlock before we finished registering
// the new progress block for newDownloadIDForProgressBlock ID. Let's clear it now and reattempt to register
if (newDownloadIDForProgressBlock) {
[_downloader setProgressImageBlock:nil callbackQueue:[self callbackQueue] withDownloadIdentifier:newDownloadIDForProgressBlock];
}
[_downloader setProgressImageBlock:nil callbackQueue:[self callbackQueue] withDownloadIdentifier:newDownloadIDForProgressBlock];
[self _updateProgressImageBlockOnDownloaderIfNeeded];
}
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Debug/AsyncDisplayKit+Debug.mm
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ - (void)updateRangeController:(ASRangeController *)controller
CGFloat leadingDisplayTuningRatio = 0;
CGFloat leadingPreloadTuningRatio = 0;

if (!((displayTuningParameters.leadingBufferScreenfuls + displayTuningParameters.trailingBufferScreenfuls) == 0)) {
if (displayTuningParameters.leadingBufferScreenfuls + displayTuningParameters.trailingBufferScreenfuls != 0) {
leadingDisplayTuningRatio = displayTuningParameters.leadingBufferScreenfuls / (displayTuningParameters.leadingBufferScreenfuls + displayTuningParameters.trailingBufferScreenfuls);
}
if (!((preloadTuningParameters.leadingBufferScreenfuls + preloadTuningParameters.trailingBufferScreenfuls) == 0)) {
if (preloadTuningParameters.leadingBufferScreenfuls + preloadTuningParameters.trailingBufferScreenfuls != 0) {
leadingPreloadTuningRatio = preloadTuningParameters.leadingBufferScreenfuls / (preloadTuningParameters.leadingBufferScreenfuls + preloadTuningParameters.trailingBufferScreenfuls);
}

Expand Down
1 change: 0 additions & 1 deletion Source/Private/TextExperiment/Utility/ASTextUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ static inline CGFloat ASTextEmojiGetDescentWithFontSize(CGFloat fontSize) {
} else {
return 0.3125 * fontSize;
}
return 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Private/_ASPendingState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ @implementation _ASPendingState
@package //Expose all ivars for ASDisplayNode to bypass getters for efficiency

UIViewAutoresizing autoresizingMask;
unsigned int edgeAntialiasingMask;
CAEdgeAntialiasingMask edgeAntialiasingMask;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hanton not a blocking comment, but I think there are other places in which we also use unsigned int instead of CAEdgeAntialiasingMask? I'm totally down to change them too :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nguyenhuy sorry for missing this comment :p

The PR for fixing this issue is ready at #1667

CGRect frame; // Frame is only to be used for synchronous views wrapped by nodes (see setFrame:)
CGRect bounds;
UIColor *backgroundColor;
Expand Down