From 64018324d5e5071eea3b3f72f939d91dc7aef029 Mon Sep 17 00:00:00 2001 From: "Jorge Boncompte [DTI2]" Date: Mon, 7 May 2012 16:53:13 +0000 Subject: lib: micro-op for thread_get() thread_trim_head() already checks that the list is not empty. Signed-off-by: Jorge Boncompte [DTI2] Signed-off-by: David Lamparter --- lib/thread.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/thread.c') diff --git a/lib/thread.c b/lib/thread.c index 784b29c6..3740147e 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -667,11 +667,10 @@ static struct thread * thread_get (struct thread_master *m, u_char type, int (*func) (struct thread *), void *arg, const char* funcname) { - struct thread *thread; + struct thread *thread = thread_trim_head (&m->unuse); - if (!thread_empty (&m->unuse)) + if (thread) { - thread = thread_trim_head (&m->unuse); if (thread->funcname) XFREE(MTYPE_THREAD_FUNCNAME, thread->funcname); } -- cgit v1.2.1