mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 23:43:03 +08:00
Merge pull request #26788 from EVAST9919/scrolling-alloc
Reduce allocation overhead in `ScrollingHitObjectContainer`
This commit is contained in:
commit
99f4b2c113
@ -184,9 +184,12 @@ namespace osu.Game.Rulesets.UI.Scrolling
|
|||||||
|
|
||||||
// We need to calculate hit object positions (including nested hit objects) as soon as possible after lifetimes
|
// We need to calculate hit object positions (including nested hit objects) as soon as possible after lifetimes
|
||||||
// to prevent hit objects displayed in a wrong position for one frame.
|
// to prevent hit objects displayed in a wrong position for one frame.
|
||||||
// Only AliveObjects need to be considered for layout (reduces overhead in the case of scroll speed changes).
|
// Only AliveEntries need to be considered for layout (reduces overhead in the case of scroll speed changes).
|
||||||
foreach (var obj in AliveObjects)
|
// We are not using AliveObjects directly to avoid selection/sorting overhead since we don't care about the order at which positions will be updated.
|
||||||
|
foreach (var entry in AliveEntries)
|
||||||
{
|
{
|
||||||
|
var obj = entry.Drawable;
|
||||||
|
|
||||||
updatePosition(obj, Time.Current);
|
updatePosition(obj, Time.Current);
|
||||||
|
|
||||||
if (layoutComputed.Contains(obj))
|
if (layoutComputed.Contains(obj))
|
||||||
|
Loading…
Reference in New Issue
Block a user