From 9064980a2fcb990357fdc59eb803961a0107d6d6 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 3 Jul 2016 15:06:46 +0900 Subject: [PATCH] Simplify TransformAutomaticProperties-GetSymbol --- .../CSharp/Transforms/PatternStatementTransform.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs b/ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs index fb0fa0bf2..0f13ac73b 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/PatternStatementTransform.cs @@ -957,11 +957,8 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms PropertyDeclaration TransformAutomaticProperties(PropertyDeclaration property) { - var propertyInfo = property.GetSymbol() as IProperty; - if (propertyInfo == null) - return null; - PropertyDefinition cecilProperty = context.TypeSystem.GetCecil(propertyInfo) as PropertyDefinition; - if (cecilProperty == null || propertyInfo.Getter == null || propertyInfo.Setter == null) + PropertyDefinition cecilProperty = context.TypeSystem.GetCecil(property.GetSymbol() as IProperty) as PropertyDefinition; + if (cecilProperty == null || cecilProperty.GetMethod == null || cecilProperty.SetMethod == null) return null; if (!(cecilProperty.GetMethod.IsCompilerGenerated() && cecilProperty.SetMethod.IsCompilerGenerated())) return null;