diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-04-06 15:55:15 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-04-06 15:55:15 +0000 |
commit | 85548cccb0ebf44e91c658ee67fef19ae28a97d3 (patch) | |
tree | 7d03f417dcc16480c498594ee6278ba8c58f465d | |
parent | e9b428e121785e04ca69e6e6e416029603b6d71b (diff) |
minor code cleanup
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@17867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | sched.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -391,15 +391,14 @@ long ast_sched_when(struct sched_context *con,int id) 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; |