Refactor to use scoped using (and also correctly dispose TagLib portion)

This commit is contained in:
Dean Herbert
2021-10-12 10:46:26 +09:00
parent f2f97602f2
commit 82f7f99f37
3 changed files with 46 additions and 41 deletions

View File

@ -22,9 +22,11 @@ namespace osu.Game.Rulesets.Edit.Checks
foreach (var file in beatmapSet.Files)
{
using Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.StoragePath);
if (data?.Length == 0)
yield return new IssueTemplateZeroBytes(this).Create(file.Filename);
using (Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.StoragePath))
{
if (data?.Length == 0)
yield return new IssueTemplateZeroBytes(this).Create(file.Filename);
}
}
}