From 646563eb3f1270e54a4612983f37c7187612835d Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Fri, 19 Jun 2015 20:10:45 -0600 Subject: [PATCH] A couple of cleanups and fixes --- include/chaiscript/dispatchkit/dispatchkit.hpp | 2 +- include/chaiscript/language/chaiscript_eval.hpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 6496ba60..38ff09c0 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -438,7 +438,7 @@ namespace chaiscript /// Set the value of an object, by name. If the object /// is not available in the current scope it is created - void add(const Boxed_Value &obj, const std::string &name) + void add(Boxed_Value obj, const std::string &name) { validate_object_name(name); auto &stack = get_stack_data(); diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp index 37df8500..6f8442ce 100644 --- a/include/chaiscript/language/chaiscript_eval.hpp +++ b/include/chaiscript/language/chaiscript_eval.hpp @@ -316,9 +316,10 @@ namespace chaiscript virtual ~Inplace_Fun_Call_AST_Node() {} virtual Boxed_Value eval_internal(chaiscript::detail::Dispatch_Engine &t_ss) const CHAISCRIPT_OVERRIDE{ - std::vector params; chaiscript::eval::detail::Function_Push_Pop fpp(t_ss); + std::vector params; + params.reserve(this->children[1]->children.size()); for (const auto &child : this->children[1]->children) { params.push_back(child->eval(t_ss)); }