Merge pull request #2856 from Malus-risus/master

Remove unnecessary parentheses
This commit is contained in:
2dust
2024-02-20 13:02:35 +08:00
committed by GitHub
8 changed files with 10 additions and 10 deletions

View File

@@ -77,8 +77,8 @@ val URLConnection.responseLength: Long
get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) contentLengthLong else contentLength.toLong()
val URI.idnHost: String
get() = (host!!).replace("[", "").replace("]", "")
get() = host!!.replace("[", "").replace("]", "")
fun String.removeWhiteSpace(): String {
return this.replace(" ", "")
}
}

View File

@@ -368,7 +368,7 @@ object V2RayServiceManager {
}
val directUplink = v2rayPoint.queryStats(TAG_DIRECT, "uplink")
val directDownlink = v2rayPoint.queryStats(TAG_DIRECT, "downlink")
val zeroSpeed = (proxyTotal == 0L && directUplink == 0L && directDownlink == 0L)
val zeroSpeed = proxyTotal == 0L && directUplink == 0L && directDownlink == 0L
if (!zeroSpeed || !lastZeroSpeed) {
if (proxyTotal == 0L) {
appendSpeedString(text, outboundTags?.firstOrNull(), 0.0, 0.0)

View File

@@ -66,7 +66,7 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
holder.itemMainBinding.tvName.text = config.remarks
holder.itemView.setBackgroundColor(Color.TRANSPARENT)
holder.itemMainBinding.tvTestResult.text = aff?.getTestDelayString() ?: ""
if ((aff?.testDelayMillis ?: 0L) < 0L) {
if (aff?.testDelayMillis ?: 0L < 0L) {
holder.itemMainBinding.tvTestResult.setTextColor(ContextCompat.getColor(mActivity, R.color.colorPingRed))
} else {
holder.itemMainBinding.tvTestResult.setTextColor(ContextCompat.getColor(mActivity, R.color.colorPing))

View File

@@ -50,7 +50,7 @@ class PerAppProxyActivity : BaseActivity() {
.map {
if (blacklist != null) {
it.forEach { one ->
if ((blacklist.contains(one.packageName))) {
if (blacklist.contains(one.packageName)) {
one.isSelected = 1
} else {
one.isSelected = 0

View File

@@ -83,7 +83,7 @@ class SettingsActivity : BaseActivity() {
// It must be greater than 15 minutes because WorkManager couldn't run tasks under 15 minutes intervals
nval =
if (TextUtils.isEmpty(nval) || (nval.toLong() < 15)) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval
if (TextUtils.isEmpty(nval) || nval.toLong() < 15) AppConfig.SUBSCRIPTION_DEFAULT_UPDATE_INTERVAL else nval
autoUpdateInterval?.summary = nval
configureUpdateTask(nval.toLong())
true

View File

@@ -996,8 +996,8 @@ object AngConfigManager {
if (srv.inbounds != null && srv.outbounds != null && srv.routing != null) {
val config = ServerConfig.create(EConfigType.CUSTOM)
config.remarks = srv.remarks
?: ("%04d-".format(count + 1) + System.currentTimeMillis()
.toString())
?: "%04d-".format(count + 1) + System.currentTimeMillis()
.toString()
config.subscriptionId = subid
config.fullConfig = srv
val key = MmkvManager.encodeServerConfig("", config)

View File

@@ -22,7 +22,7 @@ object AppManagerUtil {
val appName = applicationInfo.loadLabel(packageManager).toString()
val appIcon = applicationInfo.loadIcon(packageManager)
val isSystemApp = (applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) > 0
val isSystemApp = applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM > 0
val appInfo = AppInfo(appName, pkg.packageName, appIcon, isSystemApp, 0)
apps.add(appInfo)

View File

@@ -210,7 +210,7 @@ object Utils {
}
fun isPureIpAddress(value: String): Boolean {
return (isIpv4Address(value) || isIpv6Address(value))
return isIpv4Address(value) || isIpv6Address(value)
}
fun isIpv4Address(value: String): Boolean {