Quote:
Originally Posted by Leonardo
so strcopy(destination, maxlen, ""); is faster/better than destination[0] = 0; ?
|
Yes
1. Unless you meant than
destination[0] = '\0'; in which case, no. I missed that I did a strcopy of "", whoops.
The comment optimization above it was there because earlier in development, it didn't check so it kept going all the way down the function when the copy length was 0.
To be honest, the entire SubString function is unnecessary as long as its args are positive, as it's just a fancy wrapper for strcopy.
1Because destination is tagged as String and that will toss warnings/errors.