From c91edb616333da7168b69f54f9b67a29cffe0e6c Mon Sep 17 00:00:00 2001 From: Arseny Smirnov Date: Tue, 27 Feb 2018 11:48:16 +0300 Subject: [PATCH] SequenceDispatcher: bugfix GitOrigin-RevId: b02782f0a4247d5b6d3a1fc77d73deb240c80ad6 --- td/telegram/SequenceDispatcher.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td/telegram/SequenceDispatcher.cpp b/td/telegram/SequenceDispatcher.cpp index 004d2367..723ebed0 100644 --- a/td/telegram/SequenceDispatcher.cpp +++ b/td/telegram/SequenceDispatcher.cpp @@ -147,6 +147,9 @@ void SequenceDispatcher::on_result(NetQueryPtr query) { void SequenceDispatcher::loop() { for (; finish_i_ < data_.size() && data_[finish_i_].state_ == State::Finish; finish_i_++) { } + if (next_i_ < finish_i_) { + next_i_ = finish_i_; + } for (; next_i_ < data_.size() && data_[next_i_].state_ != State::Wait && wait_cnt_ < MAX_SIMULTANEOUS_WAIT; next_i_++) { if (data_[next_i_].state_ == State::Finish) {