From 72f63742228f8fabd6ba36a478c3606d3ab974f2 Mon Sep 17 00:00:00 2001 From: rizzo Date: Wed, 3 May 2006 17:44:30 +0000 Subject: remove useless variables, and argument checks for functions that can safely handle a NULL argument. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@24464 f38db490-d61c-443f-a65b-d21fe96a405b --- channel.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'channel.c') diff --git a/channel.c b/channel.c index c38b37547..9754b1bbd 100644 --- a/channel.c +++ b/channel.c @@ -1008,9 +1008,7 @@ struct ast_datastore *ast_channel_datastore_alloc(const struct ast_datastore_inf datastore->info = info; - if (uid != NULL) { - datastore->uid = ast_strdup(uid); - } + datastore->uid = ast_strdup(uid); return datastore; } @@ -1483,12 +1481,10 @@ int ast_answer(struct ast_channel *chan) 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 @@ int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, i 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, ","))) { -- cgit v1.2.3