Minor, use substringBeforeLast instead of hand-written code
This commit is contained in:
+1
-4
@@ -130,10 +130,7 @@ public object KotlinJavascriptSerializationUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getPackageName(filePath: String): String {
|
private fun getPackageName(filePath: String): String {
|
||||||
val lastIndexOfSep = filePath.lastIndexOf('/')
|
return filePath.substringBeforeLast('/').replace('/', '.')
|
||||||
assert(lastIndexOfSep >= 0, "expected / in $filePath")
|
|
||||||
return filePath.substring(0, lastIndexOfSep).replace('/', '.')
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getPackages(contentMap: Map<String, ByteArray>): List<String> =
|
private fun getPackages(contentMap: Map<String, ByteArray>): List<String> =
|
||||||
|
|||||||
Reference in New Issue
Block a user