Commit 8200f37
committed
Rework PooledHashSet<T> to avoid acquiring a HashSet<T> for 1 item
This change reworks PooledHashSet<T> and adds two features:
1. It is now possible to pass an IEqualityComparer<T> or a HashSetPool<T> when constructing a PooledHashSet<T>. A HashSetPool<T> will be chosen based on the IEqualityComparer<T>, or a new HashSet<T> will be created if a default pool doesn't exist.
2. A HashSet<T> won't be acquired from the pool (or created) until the set would contain at least two items.1 parent dd3344f commit 8200f37
File tree
6 files changed
+878
-34
lines changed- src
- Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp
6 files changed
+878
-34
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
610 | 610 | | |
611 | 611 | | |
612 | 612 | | |
613 | | - | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| |||
src/Compiler/Microsoft.CodeAnalysis.Razor.Compiler/src/CSharp/DefaultTagHelperDescriptorFactory.cs
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| |||
0 commit comments