Skip to content

Commit 741d2c4

Browse files
committed
Removed IEquatable implementations as there are no immutable fields
1 parent 75888aa commit 741d2c4

File tree

3 files changed

+3
-48
lines changed

3 files changed

+3
-48
lines changed

Runtime/SafeEvent.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace TNRD.Events
66
{
7-
public struct SafeEvent : IEquatable<SafeEvent>
7+
public struct SafeEvent
88
{
99
private HashSet<Action> subscriptions;
1010

@@ -78,20 +78,5 @@ public void Unsubscribe(Action action)
7878
safeEvent.Unsubscribe(action);
7979
return safeEvent;
8080
}
81-
82-
public bool Equals(SafeEvent other)
83-
{
84-
return Equals(subscriptions, other.subscriptions);
85-
}
86-
87-
public override bool Equals(object obj)
88-
{
89-
return obj is SafeEvent other && Equals(other);
90-
}
91-
92-
public override int GetHashCode()
93-
{
94-
return (subscriptions != null ? subscriptions.GetHashCode() : 0);
95-
}
9681
}
9782
}

Runtime/SafeEventOneParameter.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace TNRD.Events
66
{
7-
public struct SafeEvent<T> : IEquatable<SafeEvent<T>>
7+
public struct SafeEvent<T>
88
{
99
private HashSet<Action<T>> subscriptions;
1010

@@ -78,20 +78,5 @@ public void Unsubscribe(Action<T> action)
7878
safeEvent.Unsubscribe(action);
7979
return safeEvent;
8080
}
81-
82-
public bool Equals(SafeEvent<T> other)
83-
{
84-
return Equals(subscriptions, other.subscriptions);
85-
}
86-
87-
public override bool Equals(object obj)
88-
{
89-
return obj is SafeEvent<T> other && Equals(other);
90-
}
91-
92-
public override int GetHashCode()
93-
{
94-
return (subscriptions != null ? subscriptions.GetHashCode() : 0);
95-
}
9681
}
9782
}

Runtime/SafeEventTwoParameters.cs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace TNRD.Events
66
{
7-
public struct SafeEvent<T, T2> : IEquatable<SafeEvent<T, T2>>
7+
public struct SafeEvent<T, T2>
88
{
99
private HashSet<Action<T, T2>> subscriptions;
1010

@@ -78,20 +78,5 @@ public void Unsubscribe(Action<T, T2> action)
7878
safeEvent.Unsubscribe(action);
7979
return safeEvent;
8080
}
81-
82-
public bool Equals(SafeEvent<T, T2> other)
83-
{
84-
return Equals(subscriptions, other.subscriptions);
85-
}
86-
87-
public override bool Equals(object obj)
88-
{
89-
return obj is SafeEvent<T, T2> other && Equals(other);
90-
}
91-
92-
public override int GetHashCode()
93-
{
94-
return (subscriptions != null ? subscriptions.GetHashCode() : 0);
95-
}
9681
}
9782
}

0 commit comments

Comments
 (0)