diff --git a/app/src/main/java/com/amaze/fileutilities/home_page/ui/files/FilesViewModel.kt b/app/src/main/java/com/amaze/fileutilities/home_page/ui/files/FilesViewModel.kt index af5e8580..acc28eb7 100644 --- a/app/src/main/java/com/amaze/fileutilities/home_page/ui/files/FilesViewModel.kt +++ b/app/src/main/java/com/amaze/fileutilities/home_page/ui/files/FilesViewModel.kt @@ -2021,8 +2021,12 @@ class FilesViewModel(val applicationContext: Application) : } } - val result = priorityQueue.reversed() - largeSizeDiffAppsLiveData?.postValue(result.toMutableList()) + val result = mutableListOf() + while (priorityQueue.isNotEmpty()) { + result.add(priorityQueue.remove()) + } + + largeSizeDiffAppsLiveData?.postValue(result.asReversed()) } }