Skip to content

Commit

Permalink
Use record for MethodKey.
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Dec 15, 2024
1 parent 39cfd38 commit db8e3ec
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/IKVM.Runtime/compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ Jeroen Frijters
using System.Diagnostics;
using System.Diagnostics.SymbolStore;

using IKVM.CoreLib.Diagnostics;
using IKVM.Attributes;
using IKVM.ByteCode;

Expand All @@ -45,36 +44,11 @@ Jeroen Frijters
using LocalVariableTableEntry = IKVM.Runtime.ClassFile.Method.LocalVariableTableEntry;
using Instruction = IKVM.Runtime.ClassFile.Method.Instruction;
using InstructionFlags = IKVM.Runtime.ClassFile.Method.InstructionFlags;
using System.Runtime.CompilerServices;

namespace IKVM.Runtime
{

struct MethodKey : IEquatable<MethodKey>
{

readonly string className;
readonly string methodName;
readonly string methodSig;

internal MethodKey(string className, string methodName, string methodSig)
{
this.className = className;
this.methodName = methodName;
this.methodSig = methodSig;
}

public bool Equals(MethodKey other)
{
return className == other.className && methodName == other.methodName && methodSig == other.methodSig;
}

public override int GetHashCode()
{
return className.GetHashCode() ^ methodName.GetHashCode() ^ methodSig.GetHashCode();
}

}
record struct MethodKey(string ClassName, string MethodName, string MethodSig);

/// <summary>
/// Manages instances of <see cref="Compiler"/>.
Expand Down

0 comments on commit db8e3ec

Please sign in to comment.