From b9f53490551ddf04527b65f156222c5bbc821058 Mon Sep 17 00:00:00 2001 From: Jack Kanarish Date: Tue, 29 Oct 2019 14:18:45 -0400 Subject: [PATCH 1/3] fix: fix an issue where commands would collapse to the point of the last deleted command instead of the position in queue where the new command was going --- ICD.Common.Utils/Collections/PriorityQueue.cs | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/ICD.Common.Utils/Collections/PriorityQueue.cs b/ICD.Common.Utils/Collections/PriorityQueue.cs index 8c07ef3..ace0eb1 100644 --- a/ICD.Common.Utils/Collections/PriorityQueue.cs +++ b/ICD.Common.Utils/Collections/PriorityQueue.cs @@ -134,8 +134,6 @@ namespace ICD.Common.Utils.Collections if (remove == null) throw new ArgumentNullException("remove"); - bool inserted = false; - foreach (KeyValuePair> kvp in m_PriorityToQueue.ToArray()) { int[] removeIndices = @@ -144,35 +142,17 @@ namespace ICD.Common.Utils.Collections .Reverse() .ToArray(); - if (removeIndices.Length == 0) - continue; - foreach (int removeIndex in removeIndices) { kvp.Value.RemoveAt(removeIndex); m_Count--; } - if (!inserted) - { - int insertIndex = removeIndices[0]; - - if (insertIndex >= kvp.Value.Count) - kvp.Value.Add(item); - else - kvp.Value.Insert(insertIndex, item); - - m_Count++; - - inserted = true; - } - if (kvp.Value.Count == 0) m_PriorityToQueue.Remove(kvp.Key); } - if (!inserted) - Enqueue(item, priority); + Enqueue(item, priority); } /// From 9f1541f843ad5adc865b389018c98dda80215786 Mon Sep 17 00:00:00 2001 From: Jack Kanarish Date: Tue, 29 Oct 2019 14:19:58 -0400 Subject: [PATCH 2/3] chore: update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f79dda..1b7a5e3 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 + - Fixed an issue where commands would collapse to the point of the last deleted command instead of the position in queue where the new command was going ## [8.7.1] - 2019-08-22 ### Changed From 0a1f637b454e32e6aa204425ee9c3ed9e5cb32f4 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 29 Oct 2019 14:52:36 -0400 Subject: [PATCH 3/3] chore: Updating changelog, incrementing patch version --- CHANGELOG.md | 4 +++- ICD.Common.Utils/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b7a5e3..1ef41f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,10 @@ 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] + +## [8.7.2] - 2019-10-29 ### Changed - - Fixed an issue where commands would collapse to the point of the last deleted command instead of the position in queue where the new command was going + - Fixed a bug with PriorityQueue de-duplication where a new command would be inserted in the wrong position ## [8.7.1] - 2019-08-22 ### Changed diff --git a/ICD.Common.Utils/Properties/AssemblyInfo.cs b/ICD.Common.Utils/Properties/AssemblyInfo.cs index dc12f0d..5a7bb24 100644 --- a/ICD.Common.Utils/Properties/AssemblyInfo.cs +++ b/ICD.Common.Utils/Properties/AssemblyInfo.cs @@ -4,4 +4,4 @@ using System.Reflection; [assembly: AssemblyCompany("ICD Systems")] [assembly: AssemblyProduct("ICD.Common.Utils")] [assembly: AssemblyCopyright("Copyright © ICD Systems 2019")] -[assembly: AssemblyVersion("8.7.1.0")] +[assembly: AssemblyVersion("8.7.2.0")]