Skip to content

Commit

Permalink
Simplify nullable return
Browse files Browse the repository at this point in the history
  • Loading branch information
nichwall committed Feb 1, 2025
1 parent d4090d1 commit 9e7a76b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ object DeviceManager {
* @return The ServerConnectionConfig instance or null if not found.
*/
fun getServerConnectionConfig(id: String?): ServerConnectionConfig? {
if (id == null) return null
return deviceData.serverConnectionConfigs.find { it.id == id }
return id?.let { deviceData.serverConnectionConfigs.find { it.id == id } }
}

/**
Expand Down

0 comments on commit 9e7a76b

Please sign in to comment.