1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 07:43:00 +08:00

Remove LINQ calls in hot paths

This commit is contained in:
Dean Herbert 2024-01-05 03:22:19 +09:00
parent b809d4c068
commit 9d9e6fcfdb
No known key found for this signature in database

View File

@ -194,9 +194,33 @@ namespace osu.Game.Skinning
/// <summary>
/// Whether any samples are currently playing.
/// </summary>
public bool IsPlaying => samplesContainer.Any(s => s.Playing);
public bool IsPlaying
{
get
{
foreach (PoolableSkinnableSample s in samplesContainer)
{
if (s.Playing)
return true;
}
public bool IsPlayed => samplesContainer.Any(s => s.Played);
return false;
}
}
public bool IsPlayed
{
get
{
foreach (PoolableSkinnableSample s in samplesContainer)
{
if (s.Played)
return true;
}
return false;
}
}
public IBindable<double> AggregateVolume => samplesContainer.AggregateVolume;