From 83dc85e63b27ad5e0bfe59f0aa9ce7e6b4439104 Mon Sep 17 00:00:00 2001 From: tibbi Date: Thu, 17 Nov 2016 16:11:11 +0100 Subject: [PATCH] simplify sendsuccess at renaming dir --- .../gallery/dialogs/RenameDirectoryDialog.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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)