Skip to content

Commit 76faf81

Browse files
committed
Revert "Use == operator to simplify code"
This reverts commit ef0c7be.
1 parent a807adf commit 76faf81

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

src/eval.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,21 @@ 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-
return map_lhs == map_rhs;
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;
335349
}
336350

337351
return false;

0 commit comments

Comments
 (0)