From 42194562c1279683971cdf94815556540caf91d5 Mon Sep 17 00:00:00 2001 From: Bao-Long Nguyen-Trong Date: Sun, 17 May 2009 05:59:28 +0000 Subject: [PATCH] Minor optimization to avoid the OutOfMemoryError we have been getting --- src/com/android/email/mail/store/LocalStore.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/email/mail/store/LocalStore.java b/src/com/android/email/mail/store/LocalStore.java index ddfddcdff..aa8656d05 100644 --- a/src/com/android/email/mail/store/LocalStore.java +++ b/src/com/android/email/mail/store/LocalStore.java @@ -1447,7 +1447,11 @@ public class LocalStore extends Store implements Serializable { sbHtml.append(htmlifyString(sbText.toString())); } - Spannable markup = new SpannableString(sbHtml.toString().replaceAll("cid:", "http://cid/")); + String html = sbHtml.toString(); + if (html.indexOf("cid:")!=-1) { + html = html.replaceAll("cid:", "http://cid/"); + } + Spannable markup = new SpannableString(html); Linkify.addLinks(markup, Linkify.ALL); StringBuffer sb = new StringBuffer(markup.length()); sb.append(markup.toString());