Skip to content

Commit

Permalink
Deduplicator: Fix crash on <API34 using perceptual hash
Browse files Browse the repository at this point in the history
  • Loading branch information
d4rken committed Nov 15, 2024
1 parent 68746db commit da8dea4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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

0 comments on commit da8dea4

Please sign in to comment.