C#: Simplify using statements

This commit is contained in:
Tamas Vajk
2020-10-06 13:59:19 +02:00
parent 412b87c5c7
commit 33672a4058
21 changed files with 394 additions and 441 deletions

View File

@@ -12,18 +12,16 @@ namespace Semmle.Util
public static int ReadOutput(this ProcessStartInfo pi, out IList<string> stdout)
{
stdout = new List<string>();
using (var process = Process.Start(pi))
using var process = Process.Start(pi);
string? s;
do
{
string? s;
do
{
s = process.StandardOutput.ReadLine();
if (s != null) stdout.Add(s);
}
while (s != null);
process.WaitForExit();
return process.ExitCode;
s = process.StandardOutput.ReadLine();
if (s != null) stdout.Add(s);
}
while (s != null);
process.WaitForExit();
return process.ExitCode;
}
}
}