Skip to content

Commit

Permalink
cache big data for big perf
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdodson committed Dec 16, 2011
1 parent 49ea646 commit eb8ebba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/mobisocial/socialkit/musubi/DbUser.java
Expand Up @@ -51,6 +51,7 @@ static class InFeedDbUser extends DbUser {
private final Uri mFeedUri;
private final boolean mIsLocalUser;
private final Context mContext;
private Bitmap mPicture;

InFeedDbUser(Context context, String name, long localId, String personId,
Uri feedUri) {
Expand Down Expand Up @@ -86,8 +87,11 @@ public String getName() {

@Override
public Bitmap getPicture() {
Uri uri;
if (mPicture != null) {
return mPicture;
}

Uri uri;
String selection = null;
String[] selectionArgs = null;
if (!mIsLocalUser) {
Expand All @@ -113,7 +117,8 @@ public Bitmap getPicture() {
Log.w(Musubi.TAG, "No picture found for " + mId);
return null;
}
return BitmapFactory.decodeByteArray(pic, 0, pic.length);
mPicture = BitmapFactory.decodeByteArray(pic, 0, pic.length);
return mPicture;
} finally {
if (c != null) {
c.close();
Expand Down

0 comments on commit eb8ebba

Please sign in to comment.