Simplify how functions are stored and passed. This is the first step in allowing us to sort functions so that dispatches are attempted in an organized order (as opposed to just the order they were added in).
Should have resulted in a speed imrovement too - fewer string copies during dispatch.
This commit is contained in:
@@ -30,7 +30,7 @@ namespace chaiscript
|
||||
*/
|
||||
template<typename FunctionType>
|
||||
boost::function<FunctionType>
|
||||
functor(const std::vector<std::pair<std::string, Const_Proxy_Function > > &funcs)
|
||||
functor(const std::vector<Const_Proxy_Function> &funcs)
|
||||
{
|
||||
FunctionType *p=0;
|
||||
return detail::build_function_caller_helper(p, funcs);
|
||||
@@ -53,8 +53,8 @@ namespace chaiscript
|
||||
boost::function<FunctionType>
|
||||
functor(Const_Proxy_Function func)
|
||||
{
|
||||
std::vector<std::pair<std::string, Const_Proxy_Function > > funcs;
|
||||
funcs.push_back(std::make_pair(std::string(), func));
|
||||
std::vector<Const_Proxy_Function> funcs;
|
||||
funcs.push_back(func);
|
||||
return functor<FunctionType>(funcs);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user