RecentEmojiPack &cGetRecentEmojis() { if (cRecentEmojis().isEmpty()) { RecentEmojiPack r; if (!cRecentEmojisPreload().isEmpty()) { RecentEmojisPreload p(cRecentEmojisPreload()); cSetRecentEmojisPreload(RecentEmojisPreload()); r.reserve(p.size()); for (RecentEmojisPreload::const_iterator i = p.cbegin(), e = p.cend(); i != e; ++i) { uint64 code = ((!(i->first & 0xFFFFFFFF00000000LLU) && (i->first & 0xFFFFU) == 0xFE0FU)) ? ((i->first >> 16) & 0xFFFFU) : i->first; EmojiPtr ep(emojiFromKey(code)); if (!ep) continue; if (ep->postfix) { int32 j = 0, l = r.size(); for (; j < l; ++j) { if (emojiKey(r[j].first) == code) { break; } } if (j < l) { continue; } } r.push_back(qMakePair(ep, i->second)); } }
const RecentEmojiPack &cGetRecentEmojis() { if (cRecentEmojis().isEmpty() && !cRecentEmojisPreload().isEmpty()) { RecentEmojiPreload p(cRecentEmojisPreload()); cSetRecentEmojisPreload(RecentEmojiPreload()); RecentEmojiPack r; r.reserve(p.size()); for (RecentEmojiPreload::const_iterator i = p.cbegin(), e = p.cend(); i != e; ++i) { EmojiPtr ep(getEmoji(i->first)); if (ep) { r.push_back(qMakePair(ep, i->second)); } } cSetRecentEmojis(r); } return cRecentEmojis(); }