From afd659813d165207cdb942998565aa46e38f99d1 Mon Sep 17 00:00:00 2001 From: Syer10 Date: Fri, 23 Jul 2021 19:52:36 -0400 Subject: [PATCH] Use a map --- .../main/kotlin/suwayomi/tachidesk/InspectorMain.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/InspectorMain.kt b/server/src/main/kotlin/suwayomi/tachidesk/InspectorMain.kt index 1ac5133..8b26ef6 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/InspectorMain.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/InspectorMain.kt @@ -25,22 +25,13 @@ object InspectorMain { val (pkgName, sources) = installAPK(tmpDir) { it } - ExtensionJson( - pkgName, - sources.map { source -> SourceJson(source) } - ) + pkgName to sources.map { source -> SourceJson(source) } } else null - } + }.toMap() File(outputPath).writeText(Json.encodeToString(extensions)) } - @Serializable - data class ExtensionJson( - val pkgName: String, - val sources: List - ) - @Serializable data class SourceJson( val name: String,