Skip to content

Commit

Permalink
Remove useless orEmpty() calls left over after #891
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Nov 22, 2023
1 parent 242a24c commit e41b403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions rest/src/commonMain/kotlin/service/ChannelService.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.kord.rest.service

import dev.kord.common.entity.*
import dev.kord.common.entity.optional.orEmpty
import dev.kord.rest.builder.channel.*
import dev.kord.rest.builder.channel.thread.StartForumThreadBuilder
import dev.kord.rest.builder.channel.thread.StartThreadBuilder
Expand Down Expand Up @@ -236,7 +235,7 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques
keys[Route.MessageId] = messageId
body(MessageEditPatchRequest.serializer(), request.requests)

request.files.orEmpty().forEach { file(it) }
request.files.forEach { file(it) }
}

public suspend fun editMessage(
Expand All @@ -248,7 +247,7 @@ public class ChannelService(requestHandler: RequestHandler) : RestService(reques
keys[Route.MessageId] = messageId
body(WebhookEditMessageRequest.serializer(), request.request)

request.files.orEmpty().forEach { file(it) }
request.files.forEach { file(it) }
}

public suspend fun putChannel(
Expand Down
3 changes: 1 addition & 2 deletions rest/src/commonMain/kotlin/service/WebhookService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import dev.kord.common.annotation.KordExperimental
import dev.kord.common.entity.DiscordMessage
import dev.kord.common.entity.DiscordWebhook
import dev.kord.common.entity.Snowflake
import dev.kord.common.entity.optional.orEmpty
import dev.kord.rest.builder.message.create.WebhookMessageCreateBuilder
import dev.kord.rest.builder.message.modify.WebhookMessageModifyBuilder
import dev.kord.rest.builder.webhook.WebhookCreateBuilder
Expand Down Expand Up @@ -168,7 +167,7 @@ public class WebhookService(requestHandler: RequestHandler) : RestService(reques
webhookIdTokenMessageIdThreadId(webhookId, token, messageId, threadId)
val body = WebhookMessageModifyBuilder().apply(builder).toRequest()
body(WebhookEditMessageRequest.serializer(), body.request)
body.files.orEmpty().onEach { file(it) }
body.files.onEach { file(it) }
}
}

Expand Down

0 comments on commit e41b403

Please sign in to comment.