Skip to content

Commit

Permalink
feat: SyncSet custom Equality Comparer support (#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalPetryka authored and paulpach committed Oct 15, 2019
1 parent 84555bc commit 0f95185
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Assets/Mirror/Runtime/SyncSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,11 @@ public void UnionWith(IEnumerable<T> other)

public abstract class SyncHashSet<T> : SyncSet<T>
{
protected SyncHashSet() : base(new HashSet<T>()) { }
protected SyncHashSet(IEqualityComparer<T> comparer = null) : base(new HashSet<T>(comparer ?? EqualityComparer<T>.Default)) { }
}

public abstract class SyncSortedSet<T> : SyncSet<T>
{
protected SyncSortedSet() : base(new SortedSet<T>()) { }

protected SyncSortedSet(IComparer<T> comparer) : base(new SortedSet<T>(comparer)) { }
protected SyncSortedSet(IComparer<T> comparer = null) : base(new SortedSet<T>(comparer ?? Comparer<T>.Default)) { }
}
}

0 comments on commit 0f95185

Please sign in to comment.