1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 17:13:06 +08:00

Fix lifetime performance regression.

This commit is contained in:
smoogipooo 2017-08-07 14:07:49 +09:00
parent b1d25ed388
commit e1dfe364b2

View File

@ -22,20 +22,22 @@ namespace osu.Game.Rulesets.Objects.Drawables
{ {
} }
private double? lifetimeStart;
public override double LifetimeStart public override double LifetimeStart
{ {
get { return Math.Min(HitObject.StartTime - LifetimeOffset, base.LifetimeStart); } get { return lifetimeStart ?? HitObject.StartTime - LifetimeOffset; }
set { base.LifetimeStart = value; } set { lifetimeStart = value; }
} }
private double? lifetimeEnd;
public override double LifetimeEnd public override double LifetimeEnd
{ {
get get
{ {
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime; var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
return Math.Max(endTime + LifetimeOffset, base.LifetimeEnd); return lifetimeEnd ?? endTime + LifetimeOffset;
} }
set { base.LifetimeEnd = value; } set { lifetimeEnd = value; }
} }
protected override void AddNested(DrawableHitObject<TObject, TJudgement> h) protected override void AddNested(DrawableHitObject<TObject, TJudgement> h)