mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-25 01:01:21 +01:00
Fix a major performance regression with article fetching/creation by not using implicit hashing — use explicit and simpler hashValue that will still provide high quality.
This commit is contained in:
parent
fdb159a61b
commit
0e5051b060
@ -27,6 +27,9 @@ public struct Article: Hashable {
|
|||||||
public let authors: Set<Author>?
|
public let authors: Set<Author>?
|
||||||
public let attachments: Set<Attachment>?
|
public let attachments: Set<Attachment>?
|
||||||
public let status: ArticleStatus
|
public let status: ArticleStatus
|
||||||
|
public var hashValue: Int {
|
||||||
|
return articleID.hashValue
|
||||||
|
}
|
||||||
|
|
||||||
public init(accountID: String, 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?, authors: Set<Author>?, attachments: Set<Attachment>?, status: ArticleStatus) {
|
public init(accountID: String, 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?, authors: Set<Author>?, attachments: Set<Attachment>?, status: ArticleStatus) {
|
||||||
|
|
||||||
|
@ -28,6 +28,9 @@ struct DatabaseArticle: Hashable {
|
|||||||
let datePublished: Date?
|
let datePublished: Date?
|
||||||
let dateModified: Date?
|
let dateModified: Date?
|
||||||
let status: ArticleStatus
|
let status: ArticleStatus
|
||||||
|
var hashValue: Int {
|
||||||
|
return articleID.hashValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user