Skip to content

Commit bbc0019

Browse files
committed
bugfix
1 parent 5079d84 commit bbc0019

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/scl/simulation/context.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@ void details::SimulatorContext::runHooks(std::size_t pid, Event* event) {
4343
for (auto& [trigger, hook] : m_hooks) {
4444
// if the trigger was specified, then the hook is only run if the current
4545
// event matches the trigger type.
46-
if (trigger.has_value() && (trigger.value() == event->type())) {
47-
hook(pid, event);
46+
if (trigger.has_value()) {
47+
if (trigger.value() == event->type()) {
48+
hook(pid, event);
49+
}
4850
} else {
4951
// otherwise the hook is run unconditionally.
5052
hook(pid, event);

0 commit comments

Comments
 (0)