Thread: [Solved] Optimized Plugin?
View Single Post
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-13-2018 , 13:33   Re: Optimized Plugin?
Reply With Quote #3

Quote:
Originally Posted by Neuro Toxin View Post
I would start off by noting you dont need ConVarUpdate anymore.

ConVar caches it's value and updates automatically.
What makes you think that? ConVar.BoolValue is still a native call just like GetConVarBool which might be expensive when done in a loop in a critical callback.

You can get rid of the DeleteTimer function and just do "delete hTimer[client];". "KillTimer" does exactly the same as "CloseHandle"/"delete" if you don't use its optional "autoClose" parameter. "delete" ignores null handles and sets the variable to null afterwards - all in one go!
__________________
Peace-Maker is offline