Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicator: Fix crash on <API34 using perceptual hash #1470

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DirectLocalWalker(
return
}

val queue = LinkedList(listOf(startLookUp))
val queue = LinkedList(mutableListOf(startLookUp))

while (!queue.isEmpty()) {
val lookUp = queue.removeFirst()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import eu.darken.sdmse.common.debug.logging.logTag
import eu.darken.sdmse.common.debug.logviewer.core.LogViewLogger
import eu.darken.sdmse.common.flow.throttleLatest
import eu.darken.sdmse.common.uix.ViewModel3
import eu.darken.sdmse.main.ui.dashboard.items.*
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onCompletion
import kotlinx.coroutines.flow.onStart
import java.util.LinkedList
import javax.inject.Inject

@HiltViewModel
Expand All @@ -19,7 +21,7 @@ class LogViewViewModel @Inject constructor(
private val logViewLogger: LogViewLogger,
) : ViewModel3(dispatcherProvider = dispatcherProvider) {

private val currentLog = mutableListOf<LogViewerAdapter.LogViewerRow.Item>()
private val currentLog = LinkedList<LogViewerAdapter.LogViewerRow.Item>()

val log = logViewLogger.lines
.map {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.toList
import kotlinx.coroutines.isActive
import java.io.IOException
import java.util.LinkedList
import java.util.UUID
import javax.inject.Inject
import javax.inject.Provider
Expand Down Expand Up @@ -194,7 +195,7 @@ class PHashSleuth @Inject constructor(
.toMap()

val requiredSim = 0.95f
val remainingItems = hashedItems.keys.toMutableList()
val remainingItems = LinkedList(hashedItems.keys)
val hashBuckets = mutableSetOf<Set<Pair<APathLookup<*>, Double>>>()

updateProgressCount(Progress.Count.Percent(remainingItems.size))
Expand Down
Loading