Skip to content

Commit

Permalink
Do not check exceptionPtr() against nullptr anymore
Browse files Browse the repository at this point in the history
The function now returns an std::exception_ptr by value not by
pointer anymore.
  • Loading branch information
Dr15Jones committed Jul 15, 2022
1 parent 367c624 commit 7a502ff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion FWCore/Concurrency/interface/WaitingTaskHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace edm {
}

// ---------- const member functions ---------------------
bool taskHasFailed() const noexcept { return m_task->exceptionPtr() != nullptr; }
bool taskHasFailed() const noexcept { return static_cast<bool>(m_task->exceptionPtr()); }

bool hasTask() const noexcept { return m_task != nullptr; }
/** since oneapi::tbb::task_group is thread safe, we can return it non-const from here since
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Concurrency/src/WaitingTaskWithArenaHolder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace edm {
return holder;
}

bool WaitingTaskWithArenaHolder::taskHasFailed() const noexcept { return m_task->exceptionPtr() != nullptr; }
bool WaitingTaskWithArenaHolder::taskHasFailed() const noexcept { return static_cast<bool>(m_task->exceptionPtr()); }

bool WaitingTaskWithArenaHolder::hasTask() const noexcept { return m_task != nullptr; }

Expand Down

0 comments on commit 7a502ff

Please sign in to comment.