Skip to content

Commit 312aec5

Browse files
committed
Merge branch 'NP-1167' of https://github.com/Ultimaker/CuraFormulaeEngine into NP-1167
2 parents e3378a3 + 2f649c7 commit 312aec5

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

include/cura-formulae-engine/ast/fn_application_expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct FnApplicationExpr final : Expr
2323
std::vector<ExprPtr> args;
2424
std::vector<KeywordArg> kwargs;
2525

26-
FnApplicationExpr(ExprPtr fn, std::vector<ExprPtr> args, std::vector<KeywordArg> kwargs = {})
26+
FnApplicationExpr(ExprPtr fn, std::vector<ExprPtr>&& args, std::vector<KeywordArg>&& kwargs = {})
2727
: fn(std::move(fn))
2828
, args(std::move(args))
2929
, kwargs(std::move(kwargs))

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)