mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Fix first set of code review comments
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
get
|
||||
{
|
||||
var directoryName = System.IO.Path.GetDirectoryName(path);
|
||||
if (directoryName == null)
|
||||
if (directoryName is null)
|
||||
throw new InternalError($"Directory name for path '{path}' is null.");
|
||||
|
||||
var parent = cx.CreateFolder(directoryName);
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
readonly PDB.IMethod? methodDebugInformation;
|
||||
readonly Type declaringType;
|
||||
|
||||
string name;
|
||||
readonly string name;
|
||||
LocalVariable[]? locals;
|
||||
|
||||
public MethodImplementation? Implementation { get; private set; }
|
||||
@@ -417,7 +417,7 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
|
||||
var parentMethod = parent as Method;
|
||||
|
||||
var declType = parentMethod == null ? parent as Type : parentMethod.DeclaringType;
|
||||
var declType = parentMethod is null ? parent as Type : parentMethod.DeclaringType;
|
||||
|
||||
if (declType is null)
|
||||
throw new InternalError("Parent context of method is not a type");
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
public Namespace? ParentNamespace;
|
||||
public readonly string Name;
|
||||
|
||||
public bool IsGlobalNamespace => ParentNamespace == null;
|
||||
public bool IsGlobalNamespace => ParentNamespace is null;
|
||||
|
||||
public override string IdSuffix => ";namespace";
|
||||
|
||||
@@ -85,8 +85,8 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
get
|
||||
{
|
||||
yield return Tuples.namespaces(this, Name);
|
||||
if (!IsGlobalNamespace)
|
||||
yield return Tuples.parent_namespace(this, ParentNamespace!);
|
||||
if (ParentNamespace is object)
|
||||
yield return Tuples.parent_namespace(this, ParentNamespace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user