From 8feb72903515fbd653271fbed7efc72cb37bc33f Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Fri, 5 Feb 2021 20:37:40 +0200 Subject: [PATCH] Minor code cleanups --- app/src/main/kotlin/com/tutpro/baresip/Account.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/Account.kt b/app/src/main/kotlin/com/tutpro/baresip/Account.kt index 583c11c1..0c106484 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/Account.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/Account.kt @@ -172,15 +172,12 @@ class Account(val accp: String) { fun removeAudioCodecs(codecModule: String) { when (codecModule) { - "g711" -> { + "g711" -> removeAudioCodecsStartingWith("pcm") - } - "g722" -> { + "g722" -> removeAudioCodecsStartingWith("g722/") - } - else -> { + else -> removeAudioCodecsStartingWith(codecModule) - } } } @@ -220,7 +217,7 @@ class Account(val accp: String) { } fun checkAuthPass(ap: String): Boolean { - return (ap.length > 0) && (ap.length <= 64) && + return (ap.isNotEmpty()) && (ap.length <= 64) && Regex("^[ -~]*\$").matches(ap) && !ap.contains('"') } }