-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Some improvements to FrugalList (#6280)
* Some improvements to FrugalList - FrugalStructList's `ICollection<T>`-based constructor uses foreach to enumerate the contents of the collection. If it's an `IList<T>`, we can instead index and avoid allocating the enumerator. - Avoid multiple interface calls to `ICollection<T>.Count` in FrugalStructList's ctor - Delete a dead ctor on `ArrayItemList<T>`. That ctor was the only reason an array field may have been left null, so we can also remove subsequent null checks when accessing that array. - Use Span/Array in ArrayItemList for Clear, Contains, IndexOf, ToArray, and CopyTo rather than open-coding them * Update src/Microsoft.DotNet.Wpf/src/Shared/MS/Utility/FrugalList.cs Co-authored-by: Bradley Grainger <[email protected]> Co-authored-by: Bradley Grainger <[email protected]>
- Loading branch information
1 parent
f1cfb42
commit 9949509
Showing
1 changed file
with
52 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters