Skip to content

Commit

Permalink
Make parallel change in net-core for adding items to GroupedValueList…
Browse files Browse the repository at this point in the history
… from PR #312
  • Loading branch information
Rian Stockbower committed Sep 19, 2017
1 parent b724108 commit e0e1c0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions net-core/Ical.Net/Ical.Net.Collections/GroupedValueList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@ public virtual void Set(TGroup group, IEnumerable<TValueType> values)
{
if (ContainsKey(group))
{
var items = AllOf(group);
if (items != null)
{
// Add a value to the first matching item in the list
items.First().SetValue(values);
return;
}
AllOf(group)?.FirstOrDefault()?.SetValue(values);
return;
}

// No matching item was found, add a new item to the list
Expand Down
9 changes: 2 additions & 7 deletions v2/ical.NET.Collections/GroupedValueList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,8 @@ public virtual void Set(TGroup group, IEnumerable<TValueType> values)
{
if (ContainsKey(group))
{
// Add a value to the first matching item in the list
var item = AllOf(group).FirstOrDefault();
if (item != null)
{
item.SetValue(values);
return;
}
AllOf(group)?.FirstOrDefault()?.SetValue(values);
return;
}

// No matching item was found, add a new item to the list
Expand Down

0 comments on commit e0e1c0f

Please sign in to comment.