Quantcast

Cache computed values of custom functions when evaluating the script.

Author Johnny C. Lam <jlam88@gmail.com>
Author date 2013-07-19 05:33:24
Author local date 2013-07-19 05:33:24 +0000
Committer Johnny C. Lam <jlam88@gmail.com>
Committer date 2013-07-19 05:33:24
Committer local date 2013-07-19 05:33:24 +0000
Commit 109fb52d1ab5794d1f1358e049d21e7442554958
Tree f6fff887bc565c34949e34005bc31847bcbd1b5e
Parent bf46edded6e41eae50fd26ada91753e9097648ba
Cache computed values of custom functions when evaluating the script.

* Split out parsing AddFunction statements into its own function.

* Functions declared using AddFunction compile into a new node type. The
  new node type "customfunction" has a single child node that points to
  the master node for the function.

* Give the script an age depending on how many times it has been
  evaluated. Cache the computed values of custom function so that
  subsequent calls to the same function within the same script pull from
  the cached values instead of re-computing from scratch.

This fixes ticket 271 in the right way.

git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@977 d5049fe3-3747-40f7-a4b5-f36d6801af5f