Skip to content

Commit

Permalink
simplify error raising
Browse files Browse the repository at this point in the history
  • Loading branch information
astrowander committed Nov 11, 2024
1 parent d4fc17f commit facbe5f
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions source/MRMeshC/MRFixSelfIntersections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,8 @@ MRFaceBitSet* mrFixSelfIntersectionsGetFaces( const MRMesh* mesh_, MRProgressCal
res = auto_cast( new_from( std::move( resOrErr.value() ) ) );
}

if ( errorString )
{
std::string error = resOrErr ? "" : resOrErr.error();
if ( !error.empty() )
*errorString = auto_cast( new_from( std::move( error ) ) );
}
if ( errorString && !resOrErr )
*errorString = auto_cast( new_from( std::move( resOrErr.error() ) ) );

return res;
}
Expand All @@ -57,10 +53,6 @@ void mrFixSelfIntersectionsFix( MRMesh* mesh_, const MRFixSelfIntersectionsSetti
.subdivideEdgeLen = settings->subdivideEdgeLen,
.callback = settings->cb } );

if ( errorString )
{
std::string error = resOrErr ? "" : resOrErr.error();
if ( !error.empty() )
*errorString = auto_cast( new_from( std::move( error ) ) );
}
if ( errorString && !resOrErr )
*errorString = auto_cast( new_from( std::move( resOrErr.error() ) ) );
}

0 comments on commit facbe5f

Please sign in to comment.