Add OrderedMessage::Iterator::clear.

This commit is contained in:
levlam 2023-05-05 12:51:48 +03:00
parent 206787255b
commit a7c963dabb
2 changed files with 6 additions and 2 deletions

View File

@ -21021,7 +21021,7 @@ tl_object_ptr<td_api::messages> MessagesManager::get_dialog_history(DialogId dia
limit += offset;
offset = 0;
if (d->last_message_id == MessageId()) {
p = OrderedMessages::ConstIterator();
p.clear();
}
} else {
bool have_a_gap = false;
@ -21051,7 +21051,7 @@ tl_object_ptr<td_api::messages> MessagesManager::get_dialog_history(DialogId dia
if (have_a_gap) {
LOG(INFO) << "Have a gap near message to get chat history from";
p = OrderedMessages::ConstIterator();
p.clear();
}
if (*p != nullptr && (*p)->get_message_id() == from_message_id) {
if (offset < 0) {

View File

@ -136,6 +136,10 @@ class OrderedMessages {
cur = cur->right_.get();
}
}
void clear() {
stack_.clear();
}
};
class ConstIterator final : public IteratorBase {