RssArticle.kt: Modify functions into assigning style

Signed-off-by: 1552980358 <1552980358@qq.com>
pull/369/head
1552980358 4 years ago
parent 66e24bc1c4
commit 011b7c8255
  1. 17
      app/src/main/java/io/legado/app/data/entities/RssArticle.kt

@ -20,22 +20,14 @@ data class RssArticle(
var read: Boolean = false var read: Boolean = false
) { ) {
override fun hashCode(): Int { override fun hashCode() = link.hashCode()
return link.hashCode()
}
override fun equals(other: Any?): Boolean { override fun equals(other: Any?): Boolean {
if (other == null) { other ?: return false
return false return if (other is RssArticle) origin == other.origin && link == other.link else false
}
if (other is RssArticle) {
return origin == other.origin && link == other.link
}
return false
} }
fun toStar(): RssStar { fun toStar() = RssStar(
return RssStar(
origin = origin, origin = origin,
sort = sort, sort = sort,
title = title, title = title,
@ -47,4 +39,3 @@ data class RssArticle(
image = image image = image
) )
} }
}
Loading…
Cancel
Save