diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt index f5a635487..63674f3dd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/dialogs/RenameDirectoryDialog.kt @@ -67,9 +67,7 @@ class RenameDirectoryDialog(val activity: SimpleActivity, val dir: File, val lis private fun sendSuccess(updatedFiles: ArrayList, newDir: File) { context.toast(R.string.renaming_folder) val files = newDir.listFiles() - for (file in files) { - updatedFiles.add(file.absolutePath) - } + files.mapTo(updatedFiles) { it.absolutePath } updatedFiles.add(newDir.absolutePath) listener.onRenameDirSuccess(updatedFiles)