1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 05:22:54 +08:00

use ternary expression

This commit is contained in:
Aergwyn 2018-01-18 15:53:53 +01:00
parent 65bac6d31a
commit 56619ae926

View File

@ -15,7 +15,6 @@ using OpenTK;
using OpenTK.Graphics;
using osu.Game.Overlays.Direct;
using osu.Framework.Configuration;
using System;
namespace osu.Game.Overlays.BeatmapSet
{
@ -84,7 +83,7 @@ namespace osu.Game.Overlays.BeatmapSet
if (Playing.Value && preview != null)
{
// prevent negative (potential infinite) width if a track without length was loaded
progress.Width = (float)Math.Max(preview.CurrentTime / preview.Length, 0);
progress.Width = preview.Length > 0 ? (float)(preview.CurrentTime / preview.Length) : 0f;
}
}