Iñaki Baz Castillo wrote:
Hi, I'm wondering which solution (A or B) is more efficient in case method is NOT an INVITE:


A)  if ( (method=="INVITE") && (isflagset(5) || isbflagset(6)) )

B)  if ( mehtod=="INVITE" )

AFAIK the conditions are checked in the order they appear and stop as soon as possible. In your case in != INVITE it should be the same.

Further, if you use is_method("INVITE") it is even faster.

regards
klaus



My question is: Is faster B because does less comparasions?
or does OpenSer break A conditional during first condition (method=="INVITE") because it's false so then A and B are equally efficient?


And which is more efficient (C or D) when all the conditions are true?

C)  if ( (method=="INVITE") && (isflagset(5) || isbflagset(6)) ) {
              ....

D)  if ( method=="INVITE" ) {
             if ( (isflagset(5) || isbflagset(6)) ) {
                      ...


Thanks for any explanation.
Best regards.




_______________________________________________
Users mailing list
Users@openser.org
http://openser.org/cgi-bin/mailman/listinfo/users

Reply via email to