Skip to content

Commit

Permalink
Update cancel_computation() condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
geektoni authored and vigsterkr committed May 25, 2018
1 parent 8b44285 commit b85355c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/shogun/lib/StoppableSGObject.h
Expand Up @@ -37,11 +37,7 @@ namespace shogun
SG_FORCED_INLINE bool cancel_computation() const
{
/* Execute the callback, if present*/
bool result_callback = false;
if (m_callback)
result_callback = m_callback();

return m_cancel_computation.load() || result_callback;
return (m_callback) ? (m_cancel_computation.load() || m_callback()) : m_cancel_computation.load();
}
#endif

Expand Down

0 comments on commit b85355c

Please sign in to comment.