diff options
author | Joshua Colp <jcolp@digium.com> | 2007-06-12 13:58:13 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-06-12 13:58:13 +0000 |
commit | b3475e429a69767c9797eadc026fa7d585439ac1 (patch) | |
tree | 6f50a363ea931d2d14a0f587c675c01987889b4f /main/channel.c | |
parent | f519db04e4f23b2a52954906c6bbd446a3b5438f (diff) |
Minor code cleanup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/main/channel.c b/main/channel.c index 53fe35fa0..2ba4d3d10 100644 --- a/main/channel.c +++ b/main/channel.c @@ -395,21 +395,20 @@ int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset) { time_t whentohangup; - if (chan->whentohangup == 0) { + if (!chan->whentohangup) return (offset == 0) ? 0 : -1; - } else { - if (offset == 0) /* XXX why is this special ? */ - return (1); - else { - whentohangup = offset + time (NULL); - if (chan->whentohangup < whentohangup) - return (1); - else if (chan->whentohangup == whentohangup) - return (0); - else - return (-1); - } - } + + if (!offset) /* XXX why is this special? */ + return 1; + + whentohangup = offset + time(NULL); + + if (chan->whentohangup < whentohangup) + return 1; + else if (chan->whentohangup == whentohangup) + return 0; + else + return -1; } /*! \brief Register a new telephony channel in Asterisk */ |