Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/MRMesh/MRProgressCallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace MR
{

/// safely invokes \param cb with given value; just returning true for empty callback
inline bool reportProgress( ProgressCallback cb, float v )
inline bool reportProgress( const ProgressCallback& cb, float v )
{
if ( cb )
return cb( v );
Expand All @@ -21,7 +21,7 @@ inline bool reportProgress( ProgressCallback cb, float v )

/// safely invokes \param cb with given value if \param counter is divisible by \param divider (preferably a power of 2);
/// just returning true for empty callback
inline bool reportProgress( ProgressCallback cb, float v, size_t counter, int divider )
inline bool reportProgress( const ProgressCallback& cb, float v, size_t counter, int divider )
{
if ( cb && ( counter % divider == 0 ) )
return cb( v );
Expand All @@ -31,7 +31,7 @@ inline bool reportProgress( ProgressCallback cb, float v, size_t counter, int di
/// safely invokes \param cb with the value produced by given functor;
/// just returning true for empty callback and not evaluating the function
template<typename F>
inline bool reportProgress( ProgressCallback cb, F && f )
inline bool reportProgress( const ProgressCallback& cb, F && f )
{
if ( cb )
return cb( f() );
Expand All @@ -41,7 +41,7 @@ inline bool reportProgress( ProgressCallback cb, F && f )
/// safely invokes \param cb with the value produced by given functor if \param counter is divisible by \param divider (preferably a power of 2);
/// just returning true for empty callback and not evaluating the function
template<typename F>
inline bool reportProgress( ProgressCallback cb, F && f, size_t counter, int divider )
inline bool reportProgress( const ProgressCallback& cb, F && f, size_t counter, int divider )
{
if ( cb && ( counter % divider == 0 ) )
return cb( f() );
Expand Down
Loading