mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
fix: IcdHashSet preserves comparer when an operation creates a new IcdHashSet
This commit is contained in:
parent
470c35cab7
commit
4cd28a8a12
2 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue