From ebb1e2dd339b65ff2d2785cdf481b733948841da Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 6 Jun 2020 20:49:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/changesource/DiffCallBack.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/DiffCallBack.kt b/app/src/main/java/io/legado/app/ui/book/changesource/DiffCallBack.kt index b0a8f19ef..142ab24c2 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/DiffCallBack.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/DiffCallBack.kt @@ -24,13 +24,11 @@ class DiffCallBack(private val oldItems: List, private val newItems: override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean { val oldItem = oldItems[oldItemPosition] val newItem = newItems[newItemPosition] - if (oldItem.originName != newItem.originName) { - return false - } - if (oldItem.latestChapterTitle != newItem.latestChapterTitle) { - return false + return when { + oldItem.originName != newItem.originName -> false + oldItem.latestChapterTitle != newItem.latestChapterTitle -> false + else -> true } - return true } override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? {