Remove redundant Boolean comparison in runLoop call (#3879)

Simplified the call to `runLoop` by removing the redundant `== true` comparison. Since `decodeSettingsBool` returns a non-nullable Boolean, direct usage improves readability.
This commit is contained in:
Tamim Hossain
2024-11-05 16:00:23 +06:00
committed by GitHub
parent b107c0ac1d
commit aeca9f51c8
2 changed files with 2 additions and 2 deletions

View File

@@ -336,7 +336,7 @@ object MmkvManager {
} }
fun decodeSettingsBool(key: String): Boolean { fun decodeSettingsBool(key: String): Boolean {
return settingsStorage.decodeBool(key) return settingsStorage.decodeBool(key,false)
} }
fun decodeSettingsBool(key: String, defaultValue: Boolean): Boolean { fun decodeSettingsBool(key: String, defaultValue: Boolean): Boolean {

View File

@@ -168,7 +168,7 @@ object V2RayServiceManager {
currentConfig = config currentConfig = config
try { try {
v2rayPoint.runLoop(MmkvManager.decodeSettingsBool(AppConfig.PREF_PREFER_IPV6) == true) v2rayPoint.runLoop(MmkvManager.decodeSettingsBool(AppConfig.PREF_PREFER_IPV6))
} catch (e: Exception) { } catch (e: Exception) {
Log.d(ANG_PACKAGE, e.toString()) Log.d(ANG_PACKAGE, e.toString())
} }