Refactor updateMuxConcurrency for Null Safety and Code Simplification (#3780)

Refactored the updateMuxConcurrency function by removing redundant null checks and improving code readability. The concurrency value now defaults to 8 if null or invalid input is provided.
This commit is contained in:
Tamim Hossain
2024-10-25 17:14:28 +06:00
committed by GitHub
parent 28027b5288
commit fdfd0438c3

View File

@@ -316,13 +316,11 @@ class SettingsActivity : BaseActivity() {
}
private fun updateMuxConcurrency(value: String?) {
if (value == null) {
} else {
val concurrency = value.toIntOrNull() ?: 8
muxConcurrency?.summary = concurrency.toString()
}
val concurrency = value?.toIntOrNull() ?: 8
muxConcurrency?.summary = concurrency.toString()
}
private fun updateMuxXudpConcurrency(value: String?) {
if (value == null) {
muxXudpQuic?.isEnabled = true