use of java.util.WeakHashMap in project Slide by ccrama.
the class SubmissionCache method cacheInfo.
private static void cacheInfo(List<Submission> submissions, Context mContext, String baseSub) {
if (titles == null)
titles = new WeakHashMap<>();
if (info == null)
info = new WeakHashMap<>();
if (crosspost == null)
crosspost = new WeakHashMap<>();
for (Submission submission : submissions) {
titles.put(submission.getFullName(), getTitleSpannable(submission, mContext));
info.put(submission.getFullName(), getInfoSpannable(submission, mContext, baseSub));
crosspost.put(submission.getFullName(), getCrosspostLine(submission, mContext));
}
}
Aggregations