mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 12:07:05 +00:00
fix: dont insert at an index which was removed
This commit is contained in:
parent
f816ae771b
commit
c03833bf9d
1 changed files with 5 additions and 1 deletions
|
|
@ -148,7 +148,11 @@ namespace ICD.Common.Utils.Collections
|
|||
if (!inserted)
|
||||
{
|
||||
int insertIndex = removeIndices[0];
|
||||
kvp.Value.Insert(insertIndex, item);
|
||||
|
||||
if (insertIndex >= kvp.Value.Count)
|
||||
kvp.Value.Add(item);
|
||||
else
|
||||
kvp.Value.Insert(insertIndex, item);
|
||||
m_Count++;
|
||||
|
||||
inserted = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue