Fix feed selection when the max feed score is 0.

This occurs, for example, when searching for “macrumors.com” and adding
to the Feedbin account. All four feeds have a score of 0 since their
source is set as HTMLLink. This would also fix a case in which there are
two feeds: one with a negative score and one with a score of 0.

Since the method uses a Set the feed selected when there are multiple
feeds with an identical maximum score will be random.
This commit is contained in:
Tom Grimwood-Taylor 2019-06-03 17:11:16 +01:00
parent ac9057299a
commit 0447694142
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ struct FeedSpecifier: Hashable {
return feedSpecifiers.anyObject()
}
var currentHighScore = 0
var currentHighScore = Int.min
var currentBestFeed: FeedSpecifier? = nil
for oneFeedSpecifier in feedSpecifiers {