Minor optimization to avoid the OutOfMemoryError we have been getting

This commit is contained in:
Bao-Long Nguyen-Trong 2009-05-17 05:59:28 +00:00
parent 8e51d6cf14
commit 42194562c1

View file

@ -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());