From c4ddc2b64266ac54e4c8b25e314a7f4791d23bfa Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 7 Sep 2021 18:34:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/model/CacheBook.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/CacheBook.kt b/app/src/main/java/io/legado/app/model/CacheBook.kt index bde6cf315..efb1a05af 100644 --- a/app/src/main/java/io/legado/app/model/CacheBook.kt +++ b/app/src/main/java/io/legado/app/model/CacheBook.kt @@ -62,11 +62,11 @@ class CacheBook(var bookSource: BookSource, var book: Book) { fun addLog(log: String?) { log ?: return - synchronized(this) { + synchronized(logs) { if (logs.size > 1000) { - logs.removeAt(0) + logs.removeLastOrNull() } - logs.add(logTimeFormat.format(Date()) + " " + log) + logs.add(0, logTimeFormat.format(Date()) + " " + log) } }