Skip to content

Commit

Permalink
Fix reversed event order in deferred events
Browse files Browse the repository at this point in the history
  • Loading branch information
dziegel committed Oct 23, 2024
1 parent e97670e commit aa66c8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/cpp_active_objects/Hsm.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <memory>
#include <ranges>
#include <vector>

#include <cpp_active_objects/ActiveObjectBase.hxx>
Expand Down Expand Up @@ -68,7 +69,7 @@ private:

void RecallEvents()
{
for (const auto& event : deferred_events_)
for (const auto& event : std::ranges::reverse_view(deferred_events_))
{
TakeHighPrio(event);
}
Expand Down
3 changes: 2 additions & 1 deletion include/cpp_active_objects_embedded/Hsm.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma once

#include <memory>
#include <ranges>
#include <vector>

#include <cpp_active_objects_embedded/ActiveObjectBase.hxx>
Expand Down Expand Up @@ -68,7 +69,7 @@ private:

void RecallEvents()
{
for (const auto& event : deferred_events_)
for (const auto& event : std::ranges::reverse_view(deferred_events_))
{
TakeHighPrio(event);
}
Expand Down

0 comments on commit aa66c8d

Please sign in to comment.