From 044769414286d8791fe678c6eddd583ed3d997a4 Mon Sep 17 00:00:00 2001 From: Tom Grimwood-Taylor Date: Mon, 3 Jun 2019 17:11:16 +0100 Subject: [PATCH] Fix feed selection when the max feed score is 0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- Frameworks/Account/FeedFinder/FeedSpecifier.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/Account/FeedFinder/FeedSpecifier.swift b/Frameworks/Account/FeedFinder/FeedSpecifier.swift index 68073198e..f90e956fe 100644 --- a/Frameworks/Account/FeedFinder/FeedSpecifier.swift +++ b/Frameworks/Account/FeedFinder/FeedSpecifier.swift @@ -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 {