Skip to content

Commit

Permalink
Properly compare and set latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
slarew authored and staticfloat committed Apr 16, 2019
1 parent bb9310d commit 77885a1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contrib/mac/frameworkapp/JuliaLauncher/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,19 @@ - (void)addJuliaVariant:(JuliaVariant *)jv {
NSArray<NSNumber *> *vc = jv.versionComponents;
if (vc != nil) {
// Compare version tuple.
if (vc[0] > latestV[0] || (vc[0] == latestV[0] && vc[1] > latestV[1]) ||
(vc[0] == latestV[0] && vc[1] == latestV[1] && vc[2] > latestV[2])) {
if ([vc[0] isGreaterThan:latestV[0]] ||
([vc[0] isEqualToNumber:latestV[0]] &&
[vc[1] isGreaterThan:latestV[1]]) ||
([vc[0] isEqualToNumber:latestV[0]] &&
[vc[1] isEqualToNumber:latestV[1]] &&
[vc[2] isGreaterThan:latestV[2]])) {
latestJv = jv;
latestV = vc;
}
}
if (latestJv != self.latestKnownTaggedJulia) {
self.latestKnownTaggedJulia = latestJv;
}
}
}

Expand Down

0 comments on commit 77885a1

Please sign in to comment.