mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Remove LINQ calls in hot paths
This commit is contained in:
parent
b809d4c068
commit
9d9e6fcfdb
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user