Skip to content

Commit

Permalink
Use ec in stopped(ec), short-circuit handler idiom.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed May 11, 2024
1 parent 3192009 commit 5bff42a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ bool protocol_block_in_31800::is_idle() const NOEXCEPT
return map_->empty();
}

bool protocol_block_in_31800::handle_event(const code&,
bool protocol_block_in_31800::handle_event(const code& ec,
chase event_, event_value value) NOEXCEPT
{
if (stopped())
if (stopped(ec))
return false;

switch (event_)
Expand Down
6 changes: 3 additions & 3 deletions src/protocols/protocol_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void protocol_observer::start() NOEXCEPT
}

// protected
void protocol_observer::complete_event(const code& ec, object_key key) NOEXCEPT
void protocol_observer::complete_event(const code& ec, object_key) NOEXCEPT
{
POST(do_complete_event, ec);
}
Expand All @@ -71,10 +71,10 @@ void protocol_observer::stopping(const code& ec) NOEXCEPT
protocol::stopping(ec);
}

bool protocol_observer::handle_event(const code&, chase event_,
bool protocol_observer::handle_event(const code& ec, chase event_,
event_value) NOEXCEPT
{
if (stopped())
if (stopped(ec))
return false;

switch (event_)
Expand Down

0 comments on commit 5bff42a

Please sign in to comment.