Skip to content

Commit

Permalink
Refactored code.| #1574
Browse files Browse the repository at this point in the history
  • Loading branch information
DenBond7 committed May 30, 2022
1 parent 3d9bce9 commit aec060d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ abstract class MessageDao : BaseDao<MessageEntity> {
account: String,
folder: String,
msgsID: Collection<Long>?
):
List<MessageEntity>
): List<MessageEntity>

@Query(
"SELECT * FROM messages " +
Expand Down Expand Up @@ -460,7 +459,7 @@ abstract class MessageDao : BaseDao<MessageEntity> {
*/
@Transaction
open fun getMapOfUIDAndMsgFlags(email: String, label: String): Map<Long, String?> {
return getUIDAndFlagsPairs(email, label).map { it.uid to it.flags }.toMap()
return getUIDAndFlagsPairs(email, label).associate { it.uid to it.flags }
}

/**
Expand All @@ -473,7 +472,7 @@ abstract class MessageDao : BaseDao<MessageEntity> {
@Transaction
open suspend fun getMapOfUIDAndMsgFlagsSuspend(email: String, label: String): Map<Long, String?> =
withContext(Dispatchers.IO) {
return@withContext getUIDAndFlagsPairsSuspend(email, label).map { it.uid to it.flags }.toMap()
return@withContext getUIDAndFlagsPairsSuspend(email, label).associate { it.uid to it.flags }
}

/**
Expand Down

0 comments on commit aec060d

Please sign in to comment.