mirror of
https://github.com/bitwarden/android.git
synced 2026-03-22 06:11:38 -05:00
Use persistentListOfNotNull instead of buildList and toImmutableList
This commit is contained in:
committed by
David Perez
parent
234f49a92c
commit
727d943fae
@@ -157,12 +157,11 @@ class VaultItemViewModel @Inject constructor(
|
||||
folderState.data?.firstOrNull { folder -> folderId == folder.id }
|
||||
}
|
||||
?.name
|
||||
val relatedLocations = buildList {
|
||||
organizationName?.let { add(VaultItemLocation.Organization(it)) }
|
||||
addAll(collections.map { VaultItemLocation.Collection(it) })
|
||||
folderName?.let { add(VaultItemLocation.Folder(it)) }
|
||||
}
|
||||
.toImmutableList()
|
||||
val relatedLocations = persistentListOfNotNull(
|
||||
organizationName?.let { VaultItemLocation.Organization(it) },
|
||||
*collections.map { VaultItemLocation.Collection(it) }.toTypedArray(),
|
||||
folderName?.let { VaultItemLocation.Folder(it) },
|
||||
)
|
||||
|
||||
VaultItemStateData(
|
||||
cipher = cipherView,
|
||||
|
||||
Reference in New Issue
Block a user