]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
switch_xml_locate: don't parse the binding section at every iteration
authorMathieu Rene <mrene@avgs.ca>
Wed, 10 Jun 2009 05:03:07 +0000 (05:03 +0000)
committerMathieu Rene <mrene@avgs.ca>
Wed, 10 Jun 2009 05:03:07 +0000 (05:03 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13744 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_xml.c

index 1b77a99128deb0e3a6fdf5850dbe42884d6dd1a0..2257475bfaf9fbe970bc6c7967cd7ac2f1db8827 100644 (file)
@@ -1538,12 +1538,11 @@ SWITCH_DECLARE(switch_status_t) switch_xml_locate(const char *section,
        switch_xml_t xml = NULL;
        switch_xml_binding_t *binding;
        uint8_t loops = 0;
+       switch_xml_section_t sections = BINDINGS ? switch_xml_parse_section_string(section) : 0;
 
        switch_thread_rwlock_rdlock(B_RWLOCK);
 
        for (binding = BINDINGS; binding; binding = binding->next) {
-               switch_xml_section_t sections = switch_xml_parse_section_string(section);
-
                if (binding->sections && !(sections & binding->sections)) {
                        continue;
                }