Skip to content

Commit 8545567

Browse files
committed
Replace deprecated sumBy with sumOf
Fixed compilation issue where deprecated sumBy() was used instead of sumOf() in StringComparison.kt for calculating character offsets in multi-word matching. This was causing build failures in CI.
1 parent cfbeaf1 commit 8545567

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

android/mediaprovider/core/src/main/java/com/simplecityapps/mediaprovider/StringComparison.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ object StringComparison {
163163
splitSimilarity.copy(
164164
aMatchedIndices = splitSimilarity.aMatchedIndices,
165165
bMatchedIndices = splitSimilarity.bMatchedIndices.mapKeys {
166-
it.key + bIndex + bSplit.take(bIndex).sumBy { it.length }
166+
it.key + bIndex + bSplit.take(bIndex).sumOf { it.length }
167167
}
168168
)
169169
}
@@ -175,7 +175,7 @@ object StringComparison {
175175
val splitSimilarity = jaroWinklerDistance(aWord, b)
176176
splitSimilarity.copy(
177177
aMatchedIndices = splitSimilarity.aMatchedIndices.mapKeys {
178-
it.key + aIndex + aSplit.take(aIndex).sumBy { it.length }
178+
it.key + aIndex + aSplit.take(aIndex).sumOf { it.length }
179179
},
180180
bMatchedIndices = splitSimilarity.bMatchedIndices
181181
)

0 commit comments

Comments
 (0)