♻️ Kotlinize expression
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Nov 2019 23:51:08 +0000 (00:51 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Nov 2019 23:51:08 +0000 (00:51 +0100)
src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityLoader.kt

index 3fa87ba..b40484e 100644 (file)
@@ -49,7 +49,7 @@ class IdentityLoader @Inject constructor(private val webOfTrustConnector: WebOfT
                        }
 
        private fun OwnIdentity.doesNotHaveCorrectContext() =
-                       context != null && !hasContext(context.context)
+                       context?.let { it.context !in contexts } ?: false
 
        private fun <R> time(logMessage: (Stopwatch, Collection<R>) -> String, loader: () -> Collection<R>): Collection<R> =
                        Stopwatch.createStarted().let { stopwatch ->