Fix codefactor if part 1 (#19266)

This commit is contained in:
CarloToso
2023-03-03 23:51:53 +05:00
committed by GitHub
parent 5acc664666
commit d00407612c
25 changed files with 283 additions and 68 deletions
@@ -1146,7 +1146,11 @@ namespace System.Management.Automation
{
lock (_sync)
{
if (_stopped) return;
if (_stopped)
{
return;
}
_stopped = true;
}
@@ -1651,9 +1655,15 @@ namespace System.Management.Automation
// we incrementing refCount on the same thread and before running any processing
// so it's safe to do it without Interlocked.
if (process.StartInfo.RedirectStandardOutput) { _refCount++; }
if (process.StartInfo.RedirectStandardOutput)
{
_refCount++;
}
if (process.StartInfo.RedirectStandardError) { _refCount++; }
if (process.StartInfo.RedirectStandardError)
{
_refCount++;
}
// once we have _refCount, we can start processing
if (process.StartInfo.RedirectStandardOutput)