Simplify logic in -preferredUpdateForRegularAppcastItem method

This commit is contained in:
Zorg committed 2021-04-25 14:28:33 -07:00
1 parent 564f0c316a
commit 063974c553
1 file changed
+4 -8
+4 -8
View File
@@ -69,14 +69,7 @@
- (SUAppcastItem * _Nullable)preferredUpdateForRegularAppcastItem:(SUAppcastItem * _Nullable)regularItem secondaryUpdate:(SUAppcastItem * __autoreleasing _Nullable *)secondaryUpdate
{
if (regularItem == nil) {
if (secondaryUpdate != NULL) {
*secondaryUpdate = nil;
}
return nil;
}
SUAppcastItem *deltaItem = [[self class] deltaUpdateFromAppcastItem:regularItem hostVersion:self.host.version];
SUAppcastItem *deltaItem = (regularItem != nil) ? [[self class] deltaUpdateFromAppcastItem:regularItem hostVersion:self.host.version] : nil;
if (deltaItem != nil) {
if (secondaryUpdate != NULL) {
@@ -84,6 +77,9 @@
}
return deltaItem;
} else {
if (secondaryUpdate != NULL) {
*secondaryUpdate = nil;
}
return regularItem;
}
}