mirror of https://github.com/ppy/osu
reduce code duplication / allocations
This commit is contained in:
parent
1a5a238752
commit
ea48d6a88a
|
@ -55,6 +55,13 @@ private void createTicks()
|
|||
|
||||
var minDistanceFromEnd = Velocity * 0.01;
|
||||
|
||||
var tickSamples = Samples.Select(s => new SampleInfo
|
||||
{
|
||||
Bank = s.Bank,
|
||||
Name = @"slidertick",
|
||||
Volume = s.Volume
|
||||
}).ToList();
|
||||
|
||||
AddNested(new Fruit
|
||||
{
|
||||
Samples = Samples,
|
||||
|
@ -107,12 +114,7 @@ private void createTicks()
|
|||
{
|
||||
StartTime = t,
|
||||
X = X + Path.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||
{
|
||||
Bank = s.Bank,
|
||||
Name = @"slidertick",
|
||||
Volume = s.Volume
|
||||
}))
|
||||
Samples = tickSamples
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -125,12 +127,7 @@ private void createTicks()
|
|||
{
|
||||
StartTime = time,
|
||||
X = X + Path.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||
{
|
||||
Bank = s.Bank,
|
||||
Name = @"slidertick",
|
||||
Volume = s.Volume
|
||||
}))
|
||||
Samples = tickSamples
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue