Skip to content

Commit 2a2e16b

Browse files
committed
Fix slow AndroidAssetReader.listFiles()
1 parent 5471bc0 commit 2a2e16b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

composeApp/src/androidMain/kotlin/com/linuxcommandlibrary/app/platform/AndroidAssetReader.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import com.linuxcommandlibrary.shared.platform.AssetReader
55

66
class AndroidAssetReader(private val context: Context) : AssetReader {
77
override fun listFiles(path: String): List<String> = try {
8-
context.assets.list(path)?.toList() ?: emptyList()
8+
context.assets.open("$path/index.txt").bufferedReader().use {
9+
it.readLines()
10+
}
911
} catch (e: Exception) {
1012
emptyList()
1113
}

0 commit comments

Comments
 (0)