Replace elvis operators with .orEmpty where possible
This commit is contained in:
@@ -20,8 +20,8 @@ fun OkHttpClient.Builder.injectPatches(sourceIdProducer: () -> Long): OkHttpClie
|
||||
|
||||
fun findAndApplyPatches(sourceId: Long): EHInterceptor {
|
||||
// TODO make it so captcha doesnt auto open in manga eden while applying universal interceptors
|
||||
return if (Injekt.get<PreferencesHelper>().eh_autoSolveCaptchas().get()) ((EH_INTERCEPTORS[sourceId] ?: emptyList()) + (EH_INTERCEPTORS[EH_UNIVERSAL_INTERCEPTOR] ?: emptyList())).merge()
|
||||
else (EH_INTERCEPTORS[sourceId] ?: emptyList()).merge()
|
||||
return if (Injekt.get<PreferencesHelper>().eh_autoSolveCaptchas().get()) ((EH_INTERCEPTORS[sourceId].orEmpty()) + (EH_INTERCEPTORS[EH_UNIVERSAL_INTERCEPTOR].orEmpty())).merge()
|
||||
else (EH_INTERCEPTORS[sourceId].orEmpty()).merge()
|
||||
}
|
||||
|
||||
fun List<EHInterceptor>.merge(): EHInterceptor {
|
||||
|
||||
Reference in New Issue
Block a user