Skip to content

Commit

Permalink
Changed algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Aitorbp committed Jan 24, 2024
1 parent dcd28ab commit c16521c
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,10 @@ class GetRemoteAppRegistryOperation(private val appUrl: String?) : RemoteOperati

private fun removeSubfolder(url: String): String {
val doubleSlashIndex = url.indexOf("//")
return if (doubleSlashIndex >= 0) {
val nextSlashIndex = url.indexOf('/', doubleSlashIndex + 2)
if (nextSlashIndex >= 0) {
val result = url.substring(0, nextSlashIndex)
return if (result.endsWith("/")) result else "$result/"
} else {
if (url.endsWith("/")) url else "$url/"
}
val nextSlashIndex = url.indexOf('/', doubleSlashIndex + 2)
return if (nextSlashIndex >= 0) {
val result = url.substring(0, nextSlashIndex)
if (result.endsWith("/")) result else "$result/"
} else {
if (url.endsWith("/")) url else "$url/"
}
Expand Down

0 comments on commit c16521c

Please sign in to comment.