C#: Inline out variable declarations

This commit is contained in:
Tamas Vajk
2020-10-02 11:04:25 +02:00
parent f2e6b42aa4
commit ec63acfb0c
10 changed files with 25 additions and 30 deletions

View File

@@ -69,8 +69,11 @@ namespace Semmle.Extraction.PDB
try
{
string pdbPath;
if (peReader.TryOpenAssociatedPortablePdb(assemblyPath, s => new FileStream(s, FileMode.Open, FileAccess.Read, FileShare.Read), out provider, out pdbPath))
if (peReader.TryOpenAssociatedPortablePdb(
assemblyPath,
s => new FileStream(s, FileMode.Open, FileAccess.Read, FileShare.Read),
out provider,
out _))
{
return new MetadataPdbReader(provider);
}

View File

@@ -25,8 +25,7 @@ namespace Semmle.Extraction.PDB
document = doc;
contents = new Lazy<string?>(() =>
{
bool isEmbedded;
if (document.HasEmbeddedSource(out isEmbedded) == 0 && isEmbedded)
if (document.HasEmbeddedSource(out bool isEmbedded) == 0 && isEmbedded)
{
var rawContents = document.GetEmbeddedSource().ToArray();
return System.Text.Encoding.Default.GetString(rawContents);
@@ -63,8 +62,7 @@ namespace Semmle.Extraction.PDB
var method = reader.GetMethod(methodToken);
if (method != null)
{
int count;
if (method.GetSequencePointCount(out count) != 0 || count == 0)
if (method.GetSequencePointCount(out var count) != 0 || count == 0)
return null;
var s = method.GetSequencePoints().