-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Address a couple of warnings. #19746
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
Conversation
`guard` is better for early return because the compiler enforces calling `return`.
Generated by 🚫 dangerJS |
| static func getTags() -> [String] { | ||
|
|
||
| let context = ContextManager.sharedInstance().mainContext | ||
| let blogService = BlogService(managedObjectContext: context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crazytonyli I think this was a leftover from the various iterations on the API used to fetch resources, right?
I checked the implementation and couldn't find a reason to init the service without using it. But I might have missed something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it must be, but should be safe to remove though. Thanks!
| let currentLightIcons = allIcons.filter({ $0.isLegacy == false && $0.isBordered == true }) | ||
| .sorted(by: sortWithPriority(toItemsWithPrefix: AppIcon.defaultIconName)) | ||
| let legacyIcons = { | ||
| var icons = allIcons.filter({ $0.isLegacy == true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The warning itself was on this being a var that was never mutated. While I was at it, I also adopted guard for the early-return.
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
Just a couple of easy wins I noticed. See code for more details...
Regression Notes
RELEASE-NOTES.txtif necessary. N.A.