Give has(feed) a default implementation in Container.swift.

This commit is contained in:
Brent Simmons 2019-08-21 21:07:40 -07:00
parent fe2d329301
commit bffda93700
3 changed files with 4 additions and 8 deletions

View File

@ -649,10 +649,6 @@ public final class Account: DisplayNameProvider, UnreadCountProvider, Container,
postChildrenDidChangeNotification()
}
public func has(_ feed: Feed) -> Bool {
return flattenedFeeds().contains(feed)
}
// MARK: - Debug
public func debugDropConditionalGetInfo() {

View File

@ -95,6 +95,10 @@ public extension Container {
return existingFeed(withURL: url) != nil
}
func has(_ feed: Feed) -> Bool {
return flattenedFeeds().contains(feed)
}
func existingFeed(with feedID: String) -> Feed? {
for feed in flattenedFeeds() {
if feed.feedID == feedID {

View File

@ -102,10 +102,6 @@ public final class Folder: DisplayNameProvider, Renamable, Container, UnreadCoun
postChildrenDidChangeNotification()
}
public func has(_ feed: Feed) -> Bool {
return flattenedFeeds().contains(feed)
}
// MARK: - Hashable
public func hash(into hasher: inout Hasher) {