Skip to content

Commit 0d61293

Browse files
committed
small edit to fetching children
1 parent 2c4ef37 commit 0d61293

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

app/src/main/kotlin/com/simplemobiletools/filemanager/fragments/ItemsFragment.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,13 @@ class ItemsFragment : Fragment(), ItemsAdapter.ItemOperationsListener {
162162
}
163163

164164
private fun getChildren(file: File): Int {
165-
var fileList = file.list()
166-
if (fileList == null)
167-
return 0
165+
val fileList: Array<out String>? = file.list() ?: return 0
168166

169167
if (file.isDirectory) {
170168
return if (mShowHidden) {
171-
fileList.size
169+
fileList!!.size
172170
} else {
173-
fileList.count { fileName -> fileName[0] != '.' }
171+
fileList!!.count { fileName -> fileName[0] != '.' }
174172
}
175173
}
176174
return 0

0 commit comments

Comments
 (0)