From 990f70bbf0b34f26a304ed6cb61c293d9ef55664 Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Tue, 6 Apr 2021 17:36:31 -0700 Subject: [PATCH] Revert a few unneeded changes --- .../engine/CommandProcessorBase.cs | 1 + .../engine/ScriptCommandProcessor.cs | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/System.Management.Automation/engine/CommandProcessorBase.cs b/src/System.Management.Automation/engine/CommandProcessorBase.cs index f14d0e8b440b8..fbe0677363e74 100644 --- a/src/System.Management.Automation/engine/CommandProcessorBase.cs +++ b/src/System.Management.Automation/engine/CommandProcessorBase.cs @@ -974,6 +974,7 @@ internal void ForgetScriptException() public void Dispose() { Dispose(true); + GC.SuppressFinalize(this); } private void Dispose(bool disposing) diff --git a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs index 9bb2144e6b47e..5907523692aee 100644 --- a/src/System.Management.Automation/engine/ScriptCommandProcessor.cs +++ b/src/System.Management.Automation/engine/ScriptCommandProcessor.cs @@ -339,7 +339,7 @@ internal override void DoBegin() if (_scriptBlock.HasBeginBlock) { RunClause(_runOptimizedCode ? _scriptBlock.BeginBlock : _scriptBlock.UnoptimizedBeginBlock, - AutomationNull.Value, _input); + AutomationNull.Value, _input); } } finally @@ -410,9 +410,7 @@ internal override void Complete() if (_scriptBlock.HasEndBlock) { - Action endBlock = _runOptimizedCode - ? _scriptBlock.EndBlock - : _scriptBlock.UnoptimizedEndBlock; + var endBlock = _runOptimizedCode ? _scriptBlock.EndBlock : _scriptBlock.UnoptimizedEndBlock; if (this.CommandRuntime.InputPipe.ExternalReader == null) {