[asterisk-commits] trunk r17867 - /trunk/sched.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Apr 6 08:55:18 MST 2006
Author: rizzo
Date: Thu Apr 6 10:55:15 2006
New Revision: 17867
URL: http://svn.digium.com/view/asterisk?rev=17867&view=rev
Log:
minor code cleanup
Modified:
trunk/sched.c
Modified: trunk/sched.c
URL: http://svn.digium.com/view/asterisk/trunk/sched.c?rev=17867&r1=17866&r2=17867&view=diff
==============================================================================
--- trunk/sched.c (original)
+++ trunk/sched.c Thu Apr 6 10:55:15 2006
@@ -391,15 +391,14 @@
DEBUG(ast_log(LOG_DEBUG, "ast_sched_when()\n"));
ast_mutex_lock(&con->lock);
- s=con->schedq;
- while (s!=NULL) {
- if (s->id==id) break;
- s=s->next;
+ for (s = con->schedq; s; s = s->next) {
+ if (s->id == id)
+ break;
}
secs=-1;
if (s!=NULL) {
struct timeval now = ast_tvnow();
- secs=s->when.tv_sec-now.tv_sec;
+ secs = s->when.tv_sec - now.tv_sec;
}
ast_mutex_unlock(&con->lock);
return secs;
More information about the asterisk-commits
mailing list