Skip to content

Commit 31036be

Browse files
committed
refactor
1 parent d682e3f commit 31036be

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kotlin-insight-client/kotlin-insight-client-http/src/main/kotlin/com/linkedplanet/kotlininsightclient/http/HttpInsightAttachmentOperator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ class HttpInsightAttachmentOperator(private val context: HttpInsightClientContex
102102
override suspend fun downloadAttachmentZip(objectId: InsightObjectId): Either<InsightClientError, InputStream> =
103103
either {
104104
val attachments = getAttachments(objectId).bind()
105-
val fileMap: Map<String, InputStream> = attachments.map { attachment ->
105+
val fileMap: Map<String, InputStream> = attachments.associate { attachment ->
106106
val attachmentContent = downloadAttachment(attachment.url).bind()
107107
attachment.filename to attachmentContent
108-
}.toMap()
108+
}
109109
zipInputStreamForMultipleInputStreams(fileMap).bind()
110110
}
111111

kotlin-insight-client/kotlin-insight-client-sdk/src/main/kotlin/com/linkedplanet/kotlininsightclient/sdk/SdkInsightAttachmentOperator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ object SdkInsightAttachmentOperator : InsightAttachmentOperator {
8686
override suspend fun downloadAttachmentZip(objectId: InsightObjectId): Either<InsightClientError, InputStream> =
8787
either {
8888
val attachments = getAttachments(objectId).bind()
89-
val fileMap: Map<String, InputStream> = attachments.map { attachment ->
89+
val fileMap: Map<String, InputStream> = attachments.associate { attachment ->
9090
val attachmentContent = downloadAttachment(attachment.url).bind()
9191
attachment.filename to attachmentContent
92-
}.toMap()
92+
}
9393
zipInputStreamForMultipleInputStreams(fileMap).bind()
9494
}
9595

0 commit comments

Comments
 (0)