From 0c419b05455970ea4b009c14984785b59ba7b624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Mon, 1 May 2023 19:17:01 +0900 Subject: [PATCH] Delete finally blocks in EcmaSignatureParser (#85577) These lightweight structs are not meant to be reusable. --- .../TypeSystem/Ecma/EcmaSignatureParser.cs | 39 ++++++------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs index aa881697835e2..be72b3d71accf 100644 --- a/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs +++ b/src/coreclr/tools/Common/TypeSystem/Ecma/EcmaSignatureParser.cs @@ -327,19 +327,10 @@ public bool IsFieldSignature public MethodSignature ParseMethodSignature() { - try - { - _indexStack = new Stack(); - _indexStack.Push(0); - _embeddedSignatureDataList = new List(); - return ParseMethodSignatureInternal(skipEmbeddedSignatureData: false); - } - finally - { - _indexStack = null; - _embeddedSignatureDataList = null; - } - + _indexStack = new Stack(); + _indexStack.Push(0); + _embeddedSignatureDataList = new List(); + return ParseMethodSignatureInternal(skipEmbeddedSignatureData: false); } private MethodSignature ParseMethodSignatureInternal(bool skipEmbeddedSignatureData) @@ -473,21 +464,13 @@ public TypeDesc ParseFieldSignature() public TypeDesc ParseFieldSignature(out EmbeddedSignatureData[] embeddedSigData) { - try - { - _indexStack = new Stack(); - _indexStack.Push(1); - _indexStack.Push(0); - _embeddedSignatureDataList = new List(); - TypeDesc parsedType = ParseFieldSignature(); - embeddedSigData = _embeddedSignatureDataList.Count == 0 ? null : _embeddedSignatureDataList.ToArray(); - return parsedType; - } - finally - { - _indexStack = null; - _embeddedSignatureDataList = null; - } + _indexStack = new Stack(); + _indexStack.Push(1); + _indexStack.Push(0); + _embeddedSignatureDataList = new List(); + TypeDesc parsedType = ParseFieldSignature(); + embeddedSigData = _embeddedSignatureDataList.Count == 0 ? null : _embeddedSignatureDataList.ToArray(); + return parsedType; } public LocalVariableDefinition[] ParseLocalsSignature()