Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ internal class Helper
/// <summary>
/// A map of resources to the tasks that most recently began evaluating them.
/// </summary>
private WeakKeyDictionary<TResource, ResourcePreparationTaskAndValidity> resourcePreparationTasks = new WeakKeyDictionary<TResource, ResourcePreparationTaskAndValidity>();
private WeakKeyDictionary<TResource, ResourcePreparationTaskAndValidity> resourcePreparationTasks = new WeakKeyDictionary<TResource, ResourcePreparationTaskAndValidity>(capacity: 2);

/// <summary>
/// Initializes a new instance of the <see cref="Helper"/> class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public class JoinableTaskCollection : IEnumerable<JoinableTask>
/// The value is the number of times the joinable was added to this collection (and not yet removed)
/// if this collection is ref counted; otherwise the value is always 1.
/// </summary>
private readonly WeakKeyDictionary<JoinableTask, int> joinables = new WeakKeyDictionary<JoinableTask, int>();
private readonly WeakKeyDictionary<JoinableTask, int> joinables = new WeakKeyDictionary<JoinableTask, int>(capacity: 2);

/// <summary>
/// The set of joinable tasks that have Joined this collection -- that is, the set of joinable tasks that are interested
/// in the completion of any and all joinable tasks that belong to this collection.
/// The value is the number of times a particular joinable task has Joined this collection.
/// </summary>
private readonly WeakKeyDictionary<JoinableTask, int> joiners = new WeakKeyDictionary<JoinableTask, int>();
private readonly WeakKeyDictionary<JoinableTask, int> joiners = new WeakKeyDictionary<JoinableTask, int>(capacity: 2);

/// <summary>
/// A value indicating whether joinable tasks are only removed when completed or removed as many times as they were added.
Expand Down