I understood that it is considered a good habbit to declare local versions of global functions to make your code use less CPU cycles.
(See e.g.
https://www.wowinterface.com/forums/...ad.php?t=57151)
So I am particularly doing
Code:
local SetCVar = _G.SetCVar
because my program uses SetCVar() a lot.
But how can I now hook a function to SetCVar()?
For _G.SetCVar I would have used:
Code:
hooksecurefunc("SetCVar", MyPostSetCVar)
But this does apparently not have the desired effect, because it only hooks to _G.SetCVar
whereas my code uses the local SetCVar.
Do I need
hooksecurefunc() at all to hook to my local SetCVar?
Or what would the first argument of
hooksecurefunc() have to be for a local function?
Thanks!