Inline return statements for cleaner code (#3460)

Refactored conditional return statements to be inline.
- Simplified code readability by inlining return statements.
- Maintained functionality while improving code clarity.
This commit is contained in:
Tamim Hossain
2024-08-10 17:53:35 +06:00
committed by GitHub
parent 1652040c1c
commit ae7d9d87d2

View File

@@ -248,9 +248,7 @@ class PerAppProxyActivity : BaseActivity() {
private fun importProxyApp() { private fun importProxyApp() {
val content = Utils.getClipboard(applicationContext) val content = Utils.getClipboard(applicationContext)
if (TextUtils.isEmpty(content)) { if (TextUtils.isEmpty(content)) return
return
}
selectProxyApp(content, false) selectProxyApp(content, false)
toast(R.string.toast_success) toast(R.string.toast_success)
} }
@@ -272,9 +270,7 @@ class PerAppProxyActivity : BaseActivity() {
} else { } else {
content content
} }
if (TextUtils.isEmpty(proxyApps)) { if (TextUtils.isEmpty(proxyApps)) return false
return false
}
adapter?.blacklist?.clear() adapter?.blacklist?.clear()
@@ -314,12 +310,8 @@ class PerAppProxyActivity : BaseActivity() {
private fun inProxyApps(proxyApps: String, packageName: String, force: Boolean): Boolean { private fun inProxyApps(proxyApps: String, packageName: String, force: Boolean): Boolean {
if (force) { if (force) {
if (packageName == "com.google.android.webview") { if (packageName == "com.google.android.webview") return false
return false if (packageName.startsWith("com.google")) return true
}
if (packageName.startsWith("com.google")) {
return true
}
} }
return proxyApps.indexOf(packageName) >= 0 return proxyApps.indexOf(packageName) >= 0