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