diff --git a/CHANGELOG.md b/CHANGELOG.md index ee842c9..da1e65f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ICD.Common.Utils/Collections/IcdHashSet.cs b/ICD.Common.Utils/Collections/IcdHashSet.cs index 9c68435..8a9bab3 100644 --- a/ICD.Common.Utils/Collections/IcdHashSet.cs +++ b/ICD.Common.Utils/Collections/IcdHashSet.cs @@ -95,7 +95,7 @@ namespace ICD.Common.Utils.Collections if (set == null) throw new ArgumentNullException("set"); - IcdHashSet unionSet = new IcdHashSet(this); + IcdHashSet unionSet = new IcdHashSet(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 subtractSet = new IcdHashSet(this); + IcdHashSet subtractSet = new IcdHashSet(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 intersectionSet = new IcdHashSet(); + IcdHashSet intersectionSet = new IcdHashSet(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 output = new IcdHashSet(this); + IcdHashSet output = new IcdHashSet(m_Dict.Comparer, this); foreach (T item in set) {