Skip to content

Commit 997388b

Browse files
committed
Fix first set of code review comments
1 parent 9cdee63 commit 997388b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

csharp/extractor/Semmle.Extraction.CIL/Entities/File.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public override IEnumerable<IExtractionProduct> Contents
3737
get
3838
{
3939
var directoryName = System.IO.Path.GetDirectoryName(path);
40-
if (directoryName == null)
40+
if (directoryName is null)
4141
throw new InternalError($"Directory name for path '{path}' is null.");
4242

4343
var parent = cx.CreateFolder(directoryName);

csharp/extractor/Semmle.Extraction.CIL/Entities/Method.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ sealed class DefinitionMethod : Method, IMember
146146
readonly PDB.IMethod? methodDebugInformation;
147147
readonly Type declaringType;
148148

149-
string name;
149+
readonly string name;
150150
LocalVariable[]? locals;
151151

152152
public MethodImplementation? Implementation { get; private set; }
@@ -417,7 +417,7 @@ public MemberReferenceMethod(GenericContext gc, MemberReferenceHandle handle) :
417417

418418
var parentMethod = parent as Method;
419419

420-
var declType = parentMethod == null ? parent as Type : parentMethod.DeclaringType;
420+
var declType = parentMethod is null ? parent as Type : parentMethod.DeclaringType;
421421

422422
if (declType is null)
423423
throw new InternalError("Parent context of method is not a type");

csharp/extractor/Semmle.Extraction.CIL/Entities/Namespace.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public sealed class Namespace : TypeContainer, INamespace
2020
public Namespace? ParentNamespace;
2121
public readonly string Name;
2222

23-
public bool IsGlobalNamespace => ParentNamespace == null;
23+
public bool IsGlobalNamespace => ParentNamespace is null;
2424

2525
public override string IdSuffix => ";namespace";
2626

@@ -85,8 +85,8 @@ public override IEnumerable<IExtractionProduct> Contents
8585
get
8686
{
8787
yield return Tuples.namespaces(this, Name);
88-
if (!IsGlobalNamespace)
89-
yield return Tuples.parent_namespace(this, ParentNamespace!);
88+
if (ParentNamespace is object)
89+
yield return Tuples.parent_namespace(this, ParentNamespace);
9090
}
9191
}
9292
}

0 commit comments

Comments
 (0)