From efc85fb88f7adb6e541b84e33bfc6d67bddfeb0b Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Wed, 7 Nov 2018 15:22:52 -0300 Subject: [PATCH] [headless] don't use putAll for a single field --- .../headless/messaging/OutputConversationMessage.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/briar-headless/src/main/java/org/briarproject/briar/headless/messaging/OutputConversationMessage.kt b/briar-headless/src/main/java/org/briarproject/briar/headless/messaging/OutputConversationMessage.kt index 192d0439a..ddd9c807c 100644 --- a/briar-headless/src/main/java/org/briarproject/briar/headless/messaging/OutputConversationMessage.kt +++ b/briar-headless/src/main/java/org/briarproject/briar/headless/messaging/OutputConversationMessage.kt @@ -23,13 +23,10 @@ internal fun ConversationMessageHeader.output(contactId: ContactId, text: String return dict } -internal fun PrivateMessageHeader.output(contactId: ContactId, text: String?): JsonDict { - val dict = (this as ConversationMessageHeader).output(contactId, text) - dict.putAll( - "type" to "PrivateMessage" - ) - return dict -} +internal fun PrivateMessageHeader.output(contactId: ContactId, text: String?) = + (this as ConversationMessageHeader).output(contactId, text).apply { + put("type", "PrivateMessage") + } /** * Use only for outgoing messages that were just sent