From 0c5729765e5664488c452ed36b0c18ecf58d3bb9 Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Fri, 3 Feb 2017 22:47:34 +0000 Subject: [PATCH] Reduce nesting. --- .../Passes/CheckAmbiguousFunctions.cs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Generator/Passes/CheckAmbiguousFunctions.cs b/src/Generator/Passes/CheckAmbiguousFunctions.cs index 009c7f4a..1d084cb3 100644 --- a/src/Generator/Passes/CheckAmbiguousFunctions.cs +++ b/src/Generator/Passes/CheckAmbiguousFunctions.cs @@ -105,22 +105,22 @@ namespace CppSharp.Passes { var method1 = function as Method; var method2 = overload as Method; - if (method1 != null && method2 != null) - { - var sameParams = method1.Parameters.SequenceEqual(method2.Parameters, - ParameterTypeComparer.Instance); + if (method1 == null || method2 == null) + return false; - if (method1.IsConst && !method2.IsConst && sameParams) - { - method1.ExplicitlyIgnore(); - return true; - } + var sameParams = method1.Parameters.SequenceEqual(method2.Parameters, + ParameterTypeComparer.Instance); - if (method2.IsConst && !method1.IsConst && sameParams) - { - method2.ExplicitlyIgnore(); - return true; - } + if (method1.IsConst && !method2.IsConst && sameParams) + { + method1.ExplicitlyIgnore(); + return true; + } + + if (method2.IsConst && !method1.IsConst && sameParams) + { + method2.ExplicitlyIgnore(); + return true; } return false;