1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Optimization: don't invoke Cursor.getXXX(int) more than necessary

This commit is contained in:
Fiouz 2010-10-02 18:45:51 +00:00
parent 75984939d1
commit ef1d958092

View File

@ -4586,7 +4586,9 @@ public class LocalStore extends Store implements Serializable
private void populateFromGetMessageCursor(Cursor cursor)
throws MessagingException
{
this.setSubject(cursor.getString(0) == null ? "" : cursor.getString(0));
final String subject = cursor.getString(0);
this.setSubject(subject == null ? "" : subject);
Address[] from = Address.unpack(cursor.getString(1));
if (from.length > 0)
{
@ -4624,7 +4626,10 @@ public class LocalStore extends Store implements Serializable
this.mAttachmentCount = cursor.getInt(10);
this.setInternalDate(new Date(cursor.getLong(11)));
this.setMessageId(cursor.getString(12));
mPreview = (cursor.getString(14) == null ? "" : cursor.getString(14));
final String preview = cursor.getString(14);
mPreview = (preview == null ? "" : preview);
if (this.mFolder == null)
{
LocalFolder f = new LocalFolder(cursor.getInt(13));