[asterisk-commits] file: trunk r68901 - /trunk/main/channel.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Jun 12 06:58:14 MST 2007
Author: file
Date: Tue Jun 12 08:58:13 2007
New Revision: 68901
URL: http://svn.digium.com/view/asterisk?view=rev&rev=68901
Log:
Minor code cleanup.
Modified:
trunk/main/channel.c
Modified: trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/trunk/main/channel.c?view=diff&rev=68901&r1=68900&r2=68901
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Jun 12 08:58:13 2007
@@ -395,21 +395,20 @@
{
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 */
More information about the asterisk-commits
mailing list