Skip to content

Commit

Permalink
Update SessionId.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
laolarou726 committed Dec 25, 2023
1 parent d2a62dc commit 3c17272
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Hive.Network.Abstractions/SessionId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static SessionId FromSpan(ReadOnlySpan<byte> span)
};
}
#endif
public bool Equals(SessionId other)
public readonly bool Equals(SessionId other)
{
return Id == other.Id;
}
Expand All @@ -37,18 +37,20 @@ public override bool Equals(object? obj)
return obj is SessionId other && Equals(other);
}

public override int GetHashCode()
public readonly override int GetHashCode()
{
return Id;
}

public bool Equals(SessionId x, SessionId y)
public readonly bool Equals(SessionId x, SessionId y)
{
return x.Id == y.Id;
}

public int GetHashCode(SessionId obj)
public readonly int GetHashCode(SessionId obj)
{
return obj.Id;
}

public readonly override string ToString() => Id.ToString();
}

0 comments on commit 3c17272

Please sign in to comment.