From 14c3cc70b15da9a3ac20cb25c37e704a8536dc61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Jul 2018 15:23:47 +0900 Subject: [PATCH] Prefer namespace lookups first --- osu.Game/Audio/SampleInfo.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/osu.Game/Audio/SampleInfo.cs b/osu.Game/Audio/SampleInfo.cs index 9ed40c648e..4345d09e05 100644 --- a/osu.Game/Audio/SampleInfo.cs +++ b/osu.Game/Audio/SampleInfo.cs @@ -46,16 +46,17 @@ public virtual IEnumerable LookupNames { get { - if (!string.IsNullOrEmpty(Suffix)) + if (!string.IsNullOrEmpty(Namespace)) { - if (!string.IsNullOrEmpty(Namespace)) + if (!string.IsNullOrEmpty(Suffix)) yield return $"{Namespace}/{Bank}-{Name}{Suffix}"; - yield return $"{Bank}-{Name}{Suffix}"; // Without namespace as a fallback even when we have a namespace + yield return $"{Namespace}/{Bank}-{Name}"; } - if (!string.IsNullOrEmpty(Namespace)) - yield return $"{Namespace}/{Bank}-{Name}"; - yield return $"{Bank}-{Name}"; // Without namespace as a fallback even when we have a namespace + // check non-namespace as a fallback even when we have a namespace + if (!string.IsNullOrEmpty(Suffix)) + yield return $"{Bank}-{Name}{Suffix}"; + yield return $"{Bank}-{Name}"; } }