[svn-commits] mmichelson: branch group/CCSS r240242 - /team/group/CCSS/main/ccss.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jan 14 15:20:03 CST 2010


Author: mmichelson
Date: Thu Jan 14 15:20:01 2010
New Revision: 240242

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=240242
Log:
Use a switch statement instead of an if-else ladder.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=240242&r1=240241&r2=240242
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Jan 14 15:20:01 2010
@@ -784,11 +784,14 @@
 
 	agent_policy = ast_get_cc_agent_policy(ast_channel_get_cc_config_params(chan));
 
-	if (agent_policy == AST_CC_AGENT_GENERIC) {
+	switch (agent_policy) {
+	case AST_CC_AGENT_GENERIC:
 		ast_copy_string(type, "generic", sizeof(type));
-	} else if (agent_policy == AST_CC_AGENT_NATIVE) {
+		break;
+	case AST_CC_AGENT_NATIVE:
 		ast_channel_get_cc_agent_type(chan, type, sizeof(type));
-	} else {
+		break;
+	default:
 		ast_log_dynamic_level(cc_logger_level, "Not returning agent callbacks since this channel is configured not to have a CC agent\n");
 		return NULL;
 	}




More information about the svn-commits mailing list