Skip to content

Commit 09c83be

Browse files
committed
After warning about unknown params, remove them.
1 parent cb947ed commit 09c83be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Libs/Optimize/OptimizeParameters.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,18 @@ OptimizeParameters::OptimizeParameters(ProjectHandle project) {
9494
Keys::particle_format,
9595
Keys::geodesic_remesh_percent};
9696

97-
// check if params_ has any unknown keys
97+
std::vector<std::string> to_remove;
98+
99+
// check if params_ has any unknown keys, and remove
98100
for (auto& param : params_.get_map()) {
99101
if (std::find(all_params.begin(), all_params.end(), param.first) == all_params.end()) {
100102
SW_WARN("Unknown Optimization parameter: " + param.first);
103+
to_remove.push_back(param.first);
101104
}
102105
}
106+
for (auto& param : to_remove) {
107+
params_.remove_entry(param);
108+
}
103109
}
104110

105111
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)