From ac1e68af7808d073b152ff4669cc0ed55536f0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Sat, 15 Feb 2014 22:24:08 +0100 Subject: [PATCH] use built-in TextUtils.join instead of StringBuilder --- src/com/fsck/k9/mail/Address.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/com/fsck/k9/mail/Address.java b/src/com/fsck/k9/mail/Address.java index aff348ee8..b49f425c0 100644 --- a/src/com/fsck/k9/mail/Address.java +++ b/src/com/fsck/k9/mail/Address.java @@ -14,6 +14,7 @@ import android.text.Spannable; import android.text.SpannableString; import android.text.SpannableStringBuilder; import android.text.style.ForegroundColorSpan; +import android.text.TextUtils; import android.text.util.Rfc822Token; import android.text.util.Rfc822Tokenizer; import android.util.Log; @@ -198,14 +199,7 @@ public class Address { if (addresses == null) { return null; } - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < addresses.length; i++) { - sb.append(addresses[i].toString()); - if (i < addresses.length - 1) { - sb.append(", "); - } - } - return sb.toString(); + return TextUtils.join(", ", addresses); } public String toEncodedString() {