Skip to content

Commit

Permalink
Improve symmetry in SignatureComparer
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 committed Nov 17, 2024
1 parent 72eee24 commit b28cefb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public bool Equals(IMethodDescriptor? x, IMethodDescriptor? y)

if (x is MethodSpecification specification)
return Equals(specification, y as MethodSpecification);
else if (y is MethodSpecification)
return false;

return x.Name == y.Name
&& Equals(x.DeclaringType, y.DeclaringType)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using AsmResolver.DotNet.Signatures;
using AsmResolver.PE.DotNet.Metadata.Tables;

namespace AsmResolver.DotNet.Signatures
Expand Down Expand Up @@ -31,6 +30,8 @@ public bool Equals(TypeSignature? x, TypeSignature? y)
return true;
if (x is null || y is null)
return false;
if (x.ElementType != y.ElementType)
return false;

switch (x.ElementType)
{
Expand Down

0 comments on commit b28cefb

Please sign in to comment.