From e38e1bb1d7edd5a20ff401309cc1e38eb2eb199d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 30 Dec 2021 13:22:49 +0900 Subject: [PATCH 1/2] Enable a couple of missing async related inspections --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 90bf4f09eb..44d75f265c 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -19,6 +19,7 @@ HINT DO_NOT_SHOW WARNING + WARNING HINT HINT WARNING @@ -231,6 +232,7 @@ HINT DO_NOT_SHOW WARNING + WARNING WARNING WARNING WARNING From 670a30b64bdf1f315898c7a931c0dccc3da7af70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 30 Dec 2021 23:08:05 +0900 Subject: [PATCH 2/2] Remove usage of `.Result` in `ArchiveReader` --- osu.Game/IO/Archives/ArchiveReader.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game/IO/Archives/ArchiveReader.cs b/osu.Game/IO/Archives/ArchiveReader.cs index f787534e2d..1d8da16c72 100644 --- a/osu.Game/IO/Archives/ArchiveReader.cs +++ b/osu.Game/IO/Archives/ArchiveReader.cs @@ -32,7 +32,18 @@ namespace osu.Game.IO.Archives public abstract IEnumerable Filenames { get; } - public virtual byte[] Get(string name) => GetAsync(name).Result; + public virtual byte[] Get(string name) + { + using (Stream input = GetStream(name)) + { + if (input == null) + return null; + + byte[] buffer = new byte[input.Length]; + input.Read(buffer); + return buffer; + } + } public async Task GetAsync(string name, CancellationToken cancellationToken = default) {