aboutsummaryrefslogtreecommitdiffstats
path: root/config.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-17 03:53:27 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-10-17 03:53:27 +0000
commit54ffc347bcc94f9c612f3e71b6ba477294dcc224 (patch)
tree2f5de119c6554f5aedc1a0f800d3e6aea91736c5 /config.c
parenta5cb42eb374822390654563f5c8953b370c36bfd (diff)
Improve config parsing performance (bug #5448)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6804 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'config.c')
-rwxr-xr-xconfig.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/config.c b/config.c
index 138e28f1d..846802e80 100755
--- a/config.c
+++ b/config.c
@@ -150,12 +150,15 @@ char *ast_variable_retrieve(const struct ast_config *config, const char *categor
struct ast_variable *v;
if (category) {
- for (v = ast_variable_browse(config, category); v; v = v->next)
+ char *val = NULL;
+ for (v = ast_variable_browse(config, category); v; v = v->next) {
if (variable == v->name)
return v->value;
- for (v = ast_variable_browse(config, category); v; v = v->next)
if (!strcasecmp(variable, v->name))
- return v->value;
+ val = v->value;
+ }
+ if (val)
+ return val;
} else {
struct ast_category *cat;