From ae7d9d87d25a9fedd648c6c263b7eedbc136b8a2 Mon Sep 17 00:00:00 2001 From: Tamim Hossain <132823494+CodeWithTamim@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:53:35 +0600 Subject: [PATCH] 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. --- .../com/v2ray/ang/ui/PerAppProxyActivity.kt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt index d3e372fe..ebaa3624 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/PerAppProxyActivity.kt @@ -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