diff options
Diffstat (limited to 'ICSharpCode.Decompiler/Ast/Transforms/FlattenSwitchBlocks.cs')
-rw-r--r-- | ICSharpCode.Decompiler/Ast/Transforms/FlattenSwitchBlocks.cs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/ICSharpCode.Decompiler/Ast/Transforms/FlattenSwitchBlocks.cs b/ICSharpCode.Decompiler/Ast/Transforms/FlattenSwitchBlocks.cs deleted file mode 100644 index 9595e81b..00000000 --- a/ICSharpCode.Decompiler/Ast/Transforms/FlattenSwitchBlocks.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using ICSharpCode.NRefactory.CSharp; - -namespace ICSharpCode.Decompiler.Ast.Transforms -{ - internal class FlattenSwitchBlocks : IAstTransform - { - public void Run(AstNode compilationUnit) - { - foreach (var switchSection in compilationUnit.Descendants.OfType<SwitchSection>()) - { - if (switchSection.Statements.Count != 1) - continue; - - var blockStatement = switchSection.Statements.First() as BlockStatement; - if (blockStatement == null || blockStatement.Statements.Any(st => st is VariableDeclarationStatement)) - continue; - - blockStatement.Remove(); - blockStatement.Statements.MoveTo(switchSection.Statements); - } - } - } -} |