[svn-commits] trunk r24464 - /trunk/channel.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed May 3 10:44:31 MST 2006


Author: rizzo
Date: Wed May  3 12:44:30 2006
New Revision: 24464

URL: http://svn.digium.com/view/asterisk?rev=24464&view=rev
Log:
remove useless variables, and argument checks for functions
that can safely handle a NULL argument.


Modified:
    trunk/channel.c

Modified: trunk/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/channel.c?rev=24464&r1=24463&r2=24464&view=diff
==============================================================================
--- trunk/channel.c (original)
+++ trunk/channel.c Wed May  3 12:44:30 2006
@@ -1008,9 +1008,7 @@
 
 	datastore->info = info;
 
-	if (uid != NULL) {
-		datastore->uid = ast_strdup(uid);
-	}
+	datastore->uid = ast_strdup(uid);
 
 	return datastore;
 }
@@ -1483,12 +1481,10 @@
 		if (chan->tech->answer)
 			res = chan->tech->answer(chan);
 		ast_setstate(chan, AST_STATE_UP);
-		if (chan->cdr)
-			ast_cdr_answer(chan->cdr);
+		ast_cdr_answer(chan->cdr);
 		break;
 	case AST_STATE_UP:
-		if (chan->cdr)
-			ast_cdr_answer(chan->cdr);
+		ast_cdr_answer(chan->cdr);
 		break;
 	}
 	ast_channel_unlock(chan);
@@ -3736,14 +3732,13 @@
 
 ast_group_t ast_get_group(char *s)
 {
-	char *copy;
 	char *piece;
-	char *c=NULL;
+	char *c;
 	int start=0, finish=0, x;
 	ast_group_t group = 0;
 
-	c = copy = ast_strdupa(s);
-	if (!copy)
+	c = ast_strdupa(s);
+	if (!c)
 		return 0;
 	
 	while ((piece = strsep(&c, ","))) {



More information about the svn-commits mailing list