[Asterisk-cvs] asterisk config.c,1.76,1.77

markster markster
Sun Oct 16 23:59:23 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv27014

Modified Files:
	config.c 
Log Message:
Improve config parsing performance (bug #5448)


Index: config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/config.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -d -r1.76 -r1.77
--- config.c	14 Sep 2005 20:46:49 -0000	1.76
+++ config.c	17 Oct 2005 03:53:27 -0000	1.77
@@ -150,12 +150,15 @@
 	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;
 




More information about the svn-commits mailing list