Code

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Code

Michael Ciupka-2
Hello,


what are the difference between the two commands:
1. if (method == "INVITE")
2. if (ismethod("INVITE"))

i hope somebody can help me.

Regards
Michael

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Code

Brett Nemeroff
I *think* programing style. :)

I'd be interested in knowing if there is a performance improvement for one versus the other.
-Brett


On Fri, May 1, 2009 at 10:21 AM, Michael Ciupka <[hidden email]> wrote:
Hello,


what are the difference between the two commands:
1. if (method == "INVITE")
2. if (ismethod("INVITE"))

i hope somebody can help me.

Regards
Michael

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Code

Bogdan-Andrei Iancu
Actually it is a performance difference between:

(method == "INVITE") does a string comparison, so slower

(is_method("INVITE")) does an ID/integer comparison, so faster

Regards,
Bogdan

Brett Nemeroff wrote:

> I *think* programing style. :)
>
> I'd be interested in knowing if there is a performance improvement for
> one versus the other.
> -Brett
>
>
> On Fri, May 1, 2009 at 10:21 AM, Michael Ciupka
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     Hello,
>
>
>     what are the difference between the two commands:
>     1. if (method == "INVITE")
>     2. if (ismethod("INVITE"))
>
>     i hope somebody can help me.
>
>     Regards
>     Michael
>
>     _______________________________________________
>     Users mailing list
>     [hidden email] <mailto:[hidden email]>
>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users