← Back to team overview

maria-developers team mailing list archive

Re: [GSoC CONC] Non trivial patch

 

Hi!

What is non-trivial in transforming 2 IFs into 1 with 2 conditions?

Am I skipped something?

On 02.04.15 21:29, arlene seuleu wrote:
diff --git a/libmariadb/dbug.c b/libmariadb/dbug.c
index fb7c52b..9855f97 100644
--- a/libmariadb/dbug.c
+++ b/libmariadb/dbug.c
@@ -428,9 +428,9 @@ static void read_lock_stack(CODE_STATE *cs)
 */
 static void unlock_stack(CODE_STATE *cs)
 {
-  if (cs->stack == &init_settings)
+  if (cs->stack == &init_settings && --(cs->m_read_lock_count) == 0)
   {
-    if (--(cs->m_read_lock_count) == 0)
+
       pthread_mutex_unlock(&THR_LOCK_init_settings);
   }
 }




References