04.05.2020, 02:57
So what's your reasoning for this?
Yeah, it's not required, but it suppresses errors and is not added to the compiled code if it's never called.
If I'm writing a large script with many functions, and I add to the bottom,
I can leave it there without using the function yet and it won't be compiled into the amx, but it's already written for when I do come to use it.
If I remove the 'stock' as you suggest, then I'll get an "unused" warning until I do use it, and it gets compiled into the amx regardless of whether I reference the function or not, thus potentially wasting space.
A 'stock' function does not have the potential to waste space the way a plain function does.
Yeah, it's not required, but it suppresses errors and is not added to the compiled code if it's never called.
If I'm writing a large script with many functions, and I add to the bottom,
PHP Code:
stock CheckPlayerStats(iPlayerID) {
// do something
}
If I remove the 'stock' as you suggest, then I'll get an "unused" warning until I do use it, and it gets compiled into the amx regardless of whether I reference the function or not, thus potentially wasting space.
A 'stock' function does not have the potential to waste space the way a plain function does.