mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +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();
|
||||
firstMsgTimestamp_ = QDateTime();
|
||||
|
||||
// Parse in reverse order to determine where we should not show sender's
|
||||
// name.
|
||||
auto ii = events.size();
|
||||
while (ii != 0) {
|
||||
--ii;
|
||||
|
||||
auto item = parseMessageEvent(events[ii], TimelineDirection::Top);
|
||||
// Parse in reverse order to determine where we should not show sender's name.
|
||||
for (auto it = events.rbegin(); it != events.rend(); ++it) {
|
||||
auto item = parseMessageEvent(*it, TimelineDirection::Top);
|
||||
|
||||
if (item != nullptr)
|
||||
items.push_back(item);
|
||||
|
|
Loading…
Reference in a new issue