File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
commonMain/kotlin/com/deezer/caupain/internal
jvmMain/kotlin/com/deezer/caupain/model Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ private class CachingCacheStorage(
76
76
store[url] = delegate.findAll(url)
77
77
}
78
78
val data = store.getValue(url)
79
- return data.find {
79
+ return data.firstOrNull {
80
80
varyKeys.all { (key, value) -> it.varyKeys[key] == value } && varyKeys.size == it.varyKeys.size
81
81
}
82
82
}
@@ -115,7 +115,7 @@ private class FileCacheStorage(
115
115
116
116
override suspend fun find (url : Url , varyKeys : Map <String , String >): CachedResponseData ? {
117
117
val data = readCache(key(url))
118
- return data.find {
118
+ return data.firstOrNull {
119
119
varyKeys.all { (key, value) -> it.varyKeys[key] == value } && varyKeys.size == it.varyKeys.size
120
120
}
121
121
}
Original file line number Diff line number Diff line change @@ -33,9 +33,7 @@ import java.util.ServiceLoader
33
33
internal actual fun loadPolicies (paths : Iterable <Path >, logger : Logger ): Iterable <Policy > {
34
34
val childClassLoader = URLClassLoader (
35
35
paths
36
- .asSequence()
37
- .map { it.toNioPath().toUri().toURL() }
38
- .toList()
36
+ .mapTo(mutableListOf ()) { it.toNioPath().toUri().toURL() }
39
37
.toTypedArray(),
40
38
Policy ::class .java.classLoader
41
39
)
You can’t perform that action at this time.
0 commit comments