refactor: replace lowercase() with equals()

This commit is contained in:
andrekir
2023-06-20 08:35:08 -03:00
parent bb3b1eaa85
commit 952bca3b14
2 changed files with 4 additions and 3 deletions

View File

@@ -541,8 +541,9 @@ class UIViewModel @Inject constructor(
}
}
val adminChannelIndex: Int
get() = channelSet.settingsList.map { it.name.lowercase() }.indexOf("admin")
val adminChannelIndex: Int /** matches [MeshService.adminChannelIndex] **/
get() = channelSet.settingsList.indexOfFirst { it.name.equals("admin", ignoreCase = true) }
.coerceAtLeast(0)
/**
* Write the persisted packet data out to a CSV file in the specified location.

View File

@@ -466,7 +466,7 @@ class MeshService : Service(), Logging {
/// Admin channel index
private val adminChannelIndex: Int
get() = channelSet.settingsList.indexOfFirst { it.name.lowercase() == "admin" }
get() = channelSet.settingsList.indexOfFirst { it.name.equals("admin", ignoreCase = true) }
.coerceAtLeast(0)
/// Generate a new mesh packet builder with our node as the sender, and the specified node num