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:
Jason Turner
2010-11-15 05:52:48 +00:00
parent 3aee589274
commit 7ef1b81504
4 changed files with 81 additions and 63 deletions

View File

@@ -583,9 +583,9 @@ namespace chaiscript
while (begin != end)
{
try {
if (begin->second->filter(plist))
if ((*begin)->filter(plist))
{
return (*begin->second)(plist);
return (*(*begin))(plist);
}
} catch (const bad_boxed_cast &) {
//parameter failed to cast, try again