gelldur/EventBus

ProtectedEventStream::process can't consume the _queue

gitbufenshuo opened this issue · 1 comments

                         // ProtectedEventStream::process method
                         if(limit >= _queue.size())
			{
				processEvents.reserve(_queue.size());
				std::swap(processEvents, _queue);
			}
			else
			{
				const auto countElements = std::min(limit, _queue.size());
				processEvents.reserve(countElements);
				std::move(_queue.begin(),
						  std::next(_queue.begin(), countElements),
						  std::back_inserter(processEvents));
			        // _queue.size() remains unchanged
                         }

Thank you, fixed.