Skip to content

Commit

Permalink
Add additional coverage to TryAddDefaultSize.
Browse files Browse the repository at this point in the history
  • Loading branch information
madelson committed Mar 9, 2022
1 parent d2e6ba7 commit 93d0349
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ public Dictionary<T, T> Dictionary()
collection.TryAdd(uniqueValues[i], uniqueValues[i]);
return collection;
}

[Benchmark]
public SortedDictionary<T, T> SortedDictionary()
{
var collection = new SortedDictionary<T, T>();
var uniqueValues = _uniqueValues;
for (int i = 0; i < uniqueValues.Length; i++)
collection.TryAdd(uniqueValues[i], uniqueValues[i]);
return collection;
}

[Benchmark]
public SortedList<T, T> SortedList()
{
var collection = new SortedList<T, T>();
var uniqueValues = _uniqueValues;
for (int i = 0; i < uniqueValues.Length; i++)
collection.TryAdd(uniqueValues[i], uniqueValues[i]);
return collection;
}
#endif

[Benchmark]
Expand Down

0 comments on commit 93d0349

Please sign in to comment.