View Single Post
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-17-2015 , 23:06   Re: Multi-Mod Manager v1.0-release_candidate2.hotfix2
Reply With Quote #8

Quote:
Originally Posted by addons_zz View Post
Why? Brad used it a lot (104 times) at his Galileo, to accomplish the same task.
I mean, what does you know, that he doesn't know, at the time he wrote the code.
It might not have existed when he started writing his plugin, I don't know when it was added. The biggest benefit of using it instead is self-documentation (Max Characters). Because strings and arrays are technically exactly the same thing in Pawn, it's good to use a version of sizeof that is specifically for strings.

It's also beneficial when you need to search for all strings that are passed by-ref because there should always be a charsmax() used in these cases. If you only had sizeof - 1, you would also get ALL uses of sizeof and not just strings.

Note that the performance remains unchanged because sizeof and charsmax are evaluated when you compile.
__________________
fysiks is offline