From 4e90123814b6af5e3426d9f68f131db660e0db1d Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 1 Oct 2023 19:14:43 -0700 Subject: [PATCH] Refactor --- .../main/java/gallery/memories/service/TimelineQuery.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/gallery/memories/service/TimelineQuery.kt b/app/src/main/java/gallery/memories/service/TimelineQuery.kt index d20d95e3..468ea3ed 100644 --- a/app/src/main/java/gallery/memories/service/TimelineQuery.kt +++ b/app/src/main/java/gallery/memories/service/TimelineQuery.kt @@ -108,9 +108,8 @@ import java.util.concurrent.CountDownLatch fun getSystemImagesByAUIDs(auids: List): List { val photos = mPhotoDao.getPhotosByAUIDs(auids) - val fileIds = photos.map { it.localId } - if (fileIds.isEmpty()) return listOf() - return SystemImage.getByIds(mCtx, fileIds) + if (photos.isEmpty()) return listOf() + return SystemImage.getByIds(mCtx, photos.map { it.localId }) } @Throws(JSONException::class) @@ -181,9 +180,7 @@ import java.util.concurrent.CountDownLatch @Throws(Exception::class) fun delete(auids: List, dry: Boolean): JSONObject { synchronized(this) { - if (deleting) { - throw Exception("Already deleting another set of images") - } + if (deleting) throw Exception("Already deleting another set of images") deleting = true }