fix: IcdHashSet preserves comparer when an operation creates a new IcdHashSet

This commit is contained in:
Chris Cameron
2019-01-03 13:03:51 -05:00
parent 470c35cab7
commit 4cd28a8a12
2 changed files with 6 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Changed
- IcdHashSet preserves comparer when an operation creates a new IcdHashSet
## [8.1.0] - 2019-01-02
### Added

View File

@@ -95,7 +95,7 @@ namespace ICD.Common.Utils.Collections
if (set == null)
throw new ArgumentNullException("set");
IcdHashSet<T> unionSet = new IcdHashSet<T>(this);
IcdHashSet<T> unionSet = new IcdHashSet<T>(m_Dict.Comparer, this);
unionSet.AddRange(set);
return unionSet;
@@ -112,7 +112,7 @@ namespace ICD.Common.Utils.Collections
if (set == null)
throw new ArgumentNullException("set");
IcdHashSet<T> subtractSet = new IcdHashSet<T>(this);
IcdHashSet<T> subtractSet = new IcdHashSet<T>(m_Dict.Comparer, this);
foreach (T item in set)
subtractSet.Remove(item);
@@ -131,7 +131,7 @@ namespace ICD.Common.Utils.Collections
if (set == null)
throw new ArgumentNullException("set");
IcdHashSet<T> intersectionSet = new IcdHashSet<T>();
IcdHashSet<T> intersectionSet = new IcdHashSet<T>(m_Dict.Comparer);
foreach (T item in set.Where(Contains))
intersectionSet.Add(item);
@@ -150,7 +150,7 @@ namespace ICD.Common.Utils.Collections
if (set == null)
throw new ArgumentNullException("set");
IcdHashSet<T> output = new IcdHashSet<T>(this);
IcdHashSet<T> output = new IcdHashSet<T>(m_Dict.Comparer, this);
foreach (T item in set)
{