[Asterisk-Dev] Proposed patch.
Kevin P. Fleming
kpfleming at digium.com
Fri Apr 29 14:05:33 MST 2005
Brian West wrote:
> Then again couldn't it be less expensive than the strcmp? all those
> times? :P
Well, internally getenv has to do lots of string compares to see if the
variable is present in the environment, so no, getenv() vs. strcmp() is
not a win.
However, if you check it once at the beginning of the load and then use
a int/char * variable to remember if it was present, then yes it would
be faster than the strcmp(), and we'd want to make it the first part of
the expression for that very reason.
More information about the asterisk-dev
mailing list