Use string template instead of multiple append invocations.

This commit is contained in:
Benoit Marty
2026-05-27 09:54:27 +02:00
parent f6bdf51f6d
commit 6984ab0393
@@ -32,16 +32,11 @@ internal class MapTilerTileServerStyleUriBuilder(
return buildString { return buildString {
if (customMapStyleUrl.isNullOrBlank()) { if (customMapStyleUrl.isNullOrBlank()) {
val mapId = if (darkMode) darkMapId else lightMapId val mapId = if (darkMode) darkMapId else lightMapId
append(baseUrl) append("$baseUrl/$mapId/style.json")
append("/")
append(mapId)
append("/")
append("style.json")
} else { } else {
append(customMapStyleUrl.removeSuffix("/")) append(customMapStyleUrl.removeSuffix("/"))
} }
append("?key=") append("?key=$apiKey")
append(apiKey)
} }
} }
} }