Skip to content

Commit

Permalink
Remove redundant Boolean comparison in runLoop call (#3879)
Browse files Browse the repository at this point in the history
Simplified the call to `runLoop` by removing the redundant `== true` comparison. Since `decodeSettingsBool` returns a non-nullable Boolean, direct usage improves readability.
  • Loading branch information
CodeWithTamim authored Nov 5, 2024
1 parent b107c0a commit aeca9f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ object MmkvManager {
}

fun decodeSettingsBool(key: String): Boolean {
return settingsStorage.decodeBool(key)
return settingsStorage.decodeBool(key,false)
}

fun decodeSettingsBool(key: String, defaultValue: Boolean): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ object V2RayServiceManager {
currentConfig = config

try {
v2rayPoint.runLoop(MmkvManager.decodeSettingsBool(AppConfig.PREF_PREFER_IPV6) == true)
v2rayPoint.runLoop(MmkvManager.decodeSettingsBool(AppConfig.PREF_PREFER_IPV6))
} catch (e: Exception) {
Log.d(ANG_PACKAGE, e.toString())
}
Expand Down

0 comments on commit aeca9f5

Please sign in to comment.