From 5282759c1e956b98f9fa5aad38c8abc5cdce168a Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Thu, 16 Feb 2017 02:07:57 +0000 Subject: [PATCH] Reduce nesting. --- src/Generator/Passes/FindSymbolsPass.cs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Generator/Passes/FindSymbolsPass.cs b/src/Generator/Passes/FindSymbolsPass.cs index 4190f66c..4e4f33f6 100644 --- a/src/Generator/Passes/FindSymbolsPass.cs +++ b/src/Generator/Passes/FindSymbolsPass.cs @@ -23,16 +23,17 @@ namespace CppSharp.Passes get { return wait; } set { - if (wait != value) - { - wait = value; - if (!wait && manualResetEvent != null) - { - manualResetEvent.Set(); - manualResetEvent.Dispose(); - manualResetEvent = null; - } - } + if (wait == value) + return; + + wait = value; + + if (wait || manualResetEvent == null) + return; + + manualResetEvent.Set(); + manualResetEvent.Dispose(); + manualResetEvent = null; } }