mirror of
https://github.com/ppy/osu
synced 2025-01-03 04:42:10 +00:00
Remove usage of .Result
in ArchiveReader
This commit is contained in:
parent
e38e1bb1d7
commit
670a30b64b
@ -32,7 +32,18 @@ namespace osu.Game.IO.Archives
|
||||
|
||||
public abstract IEnumerable<string> 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<byte[]> GetAsync(string name, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user