diff --git a/ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs b/ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs index dc0b678fe..26863e0bb 100644 --- a/ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs +++ b/ICSharpCode.Decompiler/IL/ControlFlow/ConditionDetection.cs @@ -347,7 +347,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow /// /// Assumes ifInst does not have an else block /// - internal static void InvertIf(Block block, IfInstruction ifInst, ILTransformContext context, bool forceBlock = true) + internal static void InvertIf(Block block, IfInstruction ifInst, ILTransformContext context) { Debug.Assert(ifInst.Parent == block); @@ -362,7 +362,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow //save a copy var thenInst = ifInst.TrueInst; - if (ifInst != block.Instructions.SecondToLastOrDefault() || forceBlock) { + if (ifInst != block.Instructions.SecondToLastOrDefault()) { // extract "else...; exit". // Note that this will only extract instructions that were previously inlined from another block // (via InlineExitBranch), so the instructions are already fully-transformed. diff --git a/ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs b/ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs index 7f1cb89a4..d73cf222f 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/ReduceNestingTransform.cs @@ -213,7 +213,7 @@ namespace ICSharpCode.Decompiler.IL // use the same exit the block has. If the block already has one (such as a leave from a try), keep it in place EnsureEndPointUnreachable(ifInst.TrueInst, block.Instructions.Last()); - ConditionDetection.InvertIf(block, ifInst, context, forceBlock: false); + ConditionDetection.InvertIf(block, ifInst, context); // ensure the exit inst of the if instruction is a keyword Debug.Assert(!(ifInst.TrueInst is Block));