mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
User reverse iterator instead of while loop
This commit is contained in:
parent
4059f17e15
commit
e6b45263bc
1 changed files with 3 additions and 7 deletions
|
@ -380,13 +380,9 @@ TimelineView::renderTopEvents(const std::vector<TimelineEvent> &events)
|
||||||
firstSender_.clear();
|
firstSender_.clear();
|
||||||
firstMsgTimestamp_ = QDateTime();
|
firstMsgTimestamp_ = QDateTime();
|
||||||
|
|
||||||
// Parse in reverse order to determine where we should not show sender's
|
// Parse in reverse order to determine where we should not show sender's name.
|
||||||
// name.
|
for (auto it = events.rbegin(); it != events.rend(); ++it) {
|
||||||
auto ii = events.size();
|
auto item = parseMessageEvent(*it, TimelineDirection::Top);
|
||||||
while (ii != 0) {
|
|
||||||
--ii;
|
|
||||||
|
|
||||||
auto item = parseMessageEvent(events[ii], TimelineDirection::Top);
|
|
||||||
|
|
||||||
if (item != nullptr)
|
if (item != nullptr)
|
||||||
items.push_back(item);
|
items.push_back(item);
|
||||||
|
|
Loading…
Reference in a new issue