diff --git a/Frameworks/Articles/Article.swift b/Frameworks/Articles/Article.swift index e748aa773..1a6b17c0b 100644 --- a/Frameworks/Articles/Article.swift +++ b/Frameworks/Articles/Article.swift @@ -59,20 +59,6 @@ public struct Article: Hashable { return databaseIDWithString("\(feedID) \(uniqueID)") } - - // MARK: - Hashable - - public func hash(into hasher: inout Hasher) { - hasher.combine(accountID) - hasher.combine(articleID) - } - - // MARK: - Equatable - - public static func ==(lhs: Article, rhs: Article) -> Bool { - - return lhs.articleID == rhs.articleID && lhs.accountID == rhs.accountID && lhs.feedID == rhs.feedID && lhs.uniqueID == rhs.uniqueID && lhs.title == rhs.title && lhs.contentHTML == rhs.contentHTML && lhs.url == rhs.url && lhs.externalURL == rhs.externalURL && lhs.summary == rhs.summary && lhs.imageURL == rhs.imageURL && lhs.bannerImageURL == rhs.bannerImageURL && lhs.datePublished == rhs.datePublished && lhs.authors == rhs.authors && lhs.attachments == rhs.attachments - } } public extension Set where Element == Article { diff --git a/Frameworks/Articles/ArticleStatus.swift b/Frameworks/Articles/ArticleStatus.swift index b41d7dc40..60caa56ce 100644 --- a/Frameworks/Articles/ArticleStatus.swift +++ b/Frameworks/Articles/ArticleStatus.swift @@ -76,7 +76,7 @@ public final class ArticleStatus: Hashable { // MARK: - Equatable public static func ==(lhs: ArticleStatus, rhs: ArticleStatus) -> Bool { - + return lhs.articleID == rhs.articleID && lhs.dateArrived == rhs.dateArrived && lhs.read == rhs.read && lhs.starred == rhs.starred && lhs.userDeleted == rhs.userDeleted } } diff --git a/Frameworks/Articles/Attachment.swift b/Frameworks/Articles/Attachment.swift index 0909f38d6..7635a62c2 100644 --- a/Frameworks/Articles/Attachment.swift +++ b/Frameworks/Articles/Attachment.swift @@ -51,17 +51,4 @@ public struct Attachment: Hashable { self.attachmentID = databaseIDWithString(s) } } - - // MARK: - Hashable - - public func hash(into hasher: inout Hasher) { - hasher.combine(attachmentID) - } - - // MARK: - Equatable - - public static func ==(lhs: Attachment, rhs: Attachment) -> Bool { - - return lhs.attachmentID == rhs.attachmentID - } } diff --git a/Frameworks/Articles/Author.swift b/Frameworks/Articles/Author.swift index a9d7f0ff3..f75775b66 100644 --- a/Frameworks/Articles/Author.swift +++ b/Frameworks/Articles/Author.swift @@ -78,19 +78,6 @@ public struct Author: Hashable { let authors = diskArray.compactMap { Author(dictionary: $0) } return authors.isEmpty ? nil : Set(authors) } - - // MARK: - Hashable - - public func hash(into hasher: inout Hasher) { - hasher.combine(authorID) - } - - // MARK: - Equatable - - public static func ==(lhs: Author, rhs: Author) -> Bool { - - return lhs.authorID == rhs.authorID - } } extension Set where Element == Author { diff --git a/Frameworks/ArticlesDatabase/DatabaseArticle.swift b/Frameworks/ArticlesDatabase/DatabaseArticle.swift index 11c16b644..1d283eacc 100644 --- a/Frameworks/ArticlesDatabase/DatabaseArticle.swift +++ b/Frameworks/ArticlesDatabase/DatabaseArticle.swift @@ -28,38 +28,6 @@ struct DatabaseArticle: Hashable { let datePublished: Date? let dateModified: Date? let status: ArticleStatus - - init(articleID: String, feedID: String, uniqueID: String, title: String?, contentHTML: String?, contentText: String?, url: String?, externalURL: String?, summary: String?, imageURL: String?, bannerImageURL: String?, datePublished: Date?, dateModified: Date?, status: ArticleStatus) { - - self.articleID = articleID - self.feedID = feedID - self.uniqueID = uniqueID - self.title = title - self.contentHTML = contentHTML - self.contentText = contentText - self.url = url - self.externalURL = externalURL - self.summary = summary - self.imageURL = imageURL - self.bannerImageURL = bannerImageURL - self.datePublished = datePublished - self.dateModified = dateModified - self.status = status - } - - // MARK: - Hashable - - public func hash(into hasher: inout Hasher) { - hasher.combine(articleID) - } - - // MARK: - Equatable - - static func ==(lhs: DatabaseArticle, rhs: DatabaseArticle) -> Bool { - - return lhs.articleID == rhs.articleID && lhs.feedID == rhs.feedID && lhs.uniqueID == rhs.uniqueID && lhs.title == rhs.title && lhs.contentHTML == rhs.contentHTML && lhs.contentText == rhs.contentText && lhs.url == rhs.url && lhs.externalURL == rhs.externalURL && lhs.summary == rhs.summary && lhs.imageURL == rhs.imageURL && lhs.bannerImageURL == rhs.bannerImageURL && lhs.datePublished == rhs.datePublished && lhs.dateModified == rhs.dateModified && lhs.status == rhs.status - } - }