Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Avoid allocations when generating RadarSignatureCells. #14438
The RadarWidget can supply a reusable buffer to each trait to avoid individual traits having to return new enumerables. Additionally, this allows the two traits to avoid LINQ and further allocations as they can manually enumerate and populate the buffer themselves.
This looks good overall, I just want to hear some opinions on the question of using
ref to explicitly state that the method is modifying the passed collection. I will not block the merge for that, but I want a ruling ( @pchote ).
Also if we go with the "loop twice so we do everything in one go" idea a very important thing to note is that the
cells collection can grow a lot, which means that with no hard size set the repeated resizing of the list can defeat the entire purpose of the PR.