improved check

release/4.3a0
Varun Agrawal 2024-08-24 15:32:18 -04:00
parent fa33bca0c7
commit c59f458fac
1 changed files with 2 additions and 2 deletions

View File

@ -132,8 +132,8 @@ bool NonlinearOptimizerParams::equals(const NonlinearOptimizerParams& other,
if (iterativeParams && other.iterativeParams) {
iterative_params_equal = iterativeParams->equals(*other.iterativeParams);
} else {
// If one or both shared pointers are null, we can't assume they are equal
iterative_params_equal = false;
// Check if either is null. If both are null, then true
iterative_params_equal = !iterativeParams && !other.iterativeParams;
}
return maxIterations == other.getMaxIterations() &&