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

Replace if judge with MAX() function in scale less than 1 #2710

Merged
merged 3 commits into from
Apr 26, 2019
Merged

Replace if judge with MAX() function in scale less than 1 #2710

merged 3 commits into from
Apr 26, 2019

Conversation

kinarobin
Copy link
Member

New Pull Request Checklist

  • I have read and understood the CONTRIBUTING guide

  • I have read the Documentation

  • I have searched for a similar pull request in the project and found none

  • I have updated this branch with the latest master to avoid conflicts (via merge from master or rebase)

  • I have added the required tests to prove the fix/feature I am adding

  • I have updated the documentation (if necessary)

  • I have run the tests and they pass

  • I have run the lint and it passes (pod lib lint)

This merge request fixes / refers to the following issues: ...

Pull Request Description

It does not change any logic in the code, Just to make the code in a pithy style!

@dreampiggy dreampiggy merged commit b4f91a6 into SDWebImage:master Apr 26, 2019
@@ -83,10 +83,7 @@ - (UIImage *)decodedImageWithData:(NSData *)data options:(nullable SDImageCoderO
CGFloat scale = 1;
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
if (scaleFactor != nil) {
Copy link
Member

Choose a reason for hiding this comment

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

@kinarob I think you can even remove all these nil check, just one line scale = MAX([scaleFactor doubleValue], 1);. 😄

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point!

@kinarobin kinarobin deleted the Replace_MAX_function_with_if_judge_in_scale_less_than_1 branch May 12, 2019 08:25
@dreampiggy dreampiggy added this to the 5.0.3 milestone May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants