From 21fe3f6cd20cb82d3d3e7de18766150555f16b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Sat, 15 Feb 2014 22:05:18 +0100 Subject: [PATCH] use built-in TextUtils.join instead of StringBuilder --- src/com/fsck/k9/activity/MessageCompose.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 87b88c889..8d93c1fa4 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -18,6 +18,7 @@ import android.os.Handler; import android.os.Parcelable; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; +import android.text.TextUtils; import android.text.TextWatcher; import android.text.util.Rfc822Tokenizer; import android.util.AttributeSet; @@ -2776,12 +2777,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, if (message.getMessageId() != null && message.getMessageId().length() > 0) { mInReplyTo = message.getMessageId(); - if (message.getReferences() != null && message.getReferences().length > 0) { - StringBuilder buffy = new StringBuilder(); - for (int i = 0; i < message.getReferences().length; i++) - buffy.append(message.getReferences()[i]); - - mReferences = buffy.toString() + " " + mInReplyTo; + String[] refs = message.getReferences(); + if (refs != null && refs.length > 0) { + mReferences = TextUtils.join("", refs) + " " + mInReplyTo; } else { mReferences = mInReplyTo; }