mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C#: Inline out variable declarations
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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().
|
||||
|
||||
Reference in New Issue
Block a user