Skip to content

Commit ef0c7be

Browse files
Use == operator to simplify code
Co-authored-by: Erwan MATHIEU <erwan.mathieu@ultimaker.com>
1 parent bcd16ac commit ef0c7be

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

src/eval.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -331,21 +331,7 @@ bool operator==(const CuraFormulaeEngine::eval::Value& lhs, const CuraFormulaeEn
331331
const auto& map_lhs = std::get<std::unordered_map<std::string, CuraFormulaeEngine::eval::Value>>(lhs.value);
332332
const auto& map_rhs = std::get<std::unordered_map<std::string, CuraFormulaeEngine::eval::Value>>(rhs.value);
333333

334-
if (map_lhs.size() != map_rhs.size())
335-
{
336-
return false;
337-
}
338-
339-
for (const auto& [key, val_lhs] : map_lhs)
340-
{
341-
const auto it = map_rhs.find(key);
342-
if (it == map_rhs.end() || val_lhs != it->second)
343-
{
344-
return false;
345-
}
346-
}
347-
348-
return true;
334+
return map_lhs == map_rhs;
349335
}
350336

351337
return false;

0 commit comments

Comments
 (0)