summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadqfirst.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-22 19:10:04 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-01-22 19:10:04 +0000
commit4e1304dcb9d11c2b66c5f0239542d65acda40790 (patch)
treeddf1d95dae751bf68374e800835c37f8fd64f56e /cpukit/score/src/threadqfirst.c
parent2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-4e1304dcb9d11c2b66c5f0239542d65acda40790.tar.bz2
2008-01-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* score/src/threadqfirst.c: Remove switch.
Diffstat (limited to 'cpukit/score/src/threadqfirst.c')
-rw-r--r--cpukit/score/src/threadqfirst.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/cpukit/score/src/threadqfirst.c b/cpukit/score/src/threadqfirst.c
index 9112b0ab72..8e268b87d9 100644
--- a/cpukit/score/src/threadqfirst.c
+++ b/cpukit/score/src/threadqfirst.c
@@ -43,19 +43,12 @@ Thread_Control *_Thread_queue_First(
Thread_queue_Control *the_thread_queue
)
{
- Thread_Control *the_thread;
+ Thread_Control * (*first_p)(Thread_queue_Control *);
- switch ( the_thread_queue->discipline ) {
- case THREAD_QUEUE_DISCIPLINE_FIFO:
- the_thread = _Thread_queue_First_fifo( the_thread_queue );
- break;
- case THREAD_QUEUE_DISCIPLINE_PRIORITY:
- the_thread = _Thread_queue_First_priority( the_thread_queue );
- break;
- default: /* this is only to prevent warnings */
- the_thread = NULL;
- break;
- }
+ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY )
+ first_p = _Thread_queue_First_priority;
+ else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */
+ first_p = _Thread_queue_First_fifo;
- return the_thread;
+ return (*first_p)( the_thread_queue );
}