Skip to content

Commit

Permalink
refactor: Remove when to put some logic in common with multiple cases
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX authored and KevinBoulongne committed Mar 11, 2025
1 parent 9a494f9 commit bca8f74
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,15 +421,11 @@ fun List<Folder>.addDividerBeforeFirstCustomFolder(dividerType: Any): List<Any>
fun List<Message>.getFoldersIds(exception: String? = null): ImpactedFolders {
val impactedFolders = ImpactedFolders()

forEach { message ->
when {
message.folderId == exception -> Unit
message.snoozeState == SnoozeState.Snoozed -> {
impactedFolders += message.folderId
impactedFolders += FolderRole.SNOOZED
}
else -> impactedFolders += message.folderId
}
for (message in this) {
if (message.folderId == exception) continue

impactedFolders += message.folderId
if (message.snoozeState == SnoozeState.Snoozed) impactedFolders += FolderRole.SNOOZED
}

return impactedFolders
Expand Down

0 comments on commit bca8f74

Please sign in to comment.