1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:17:26 +08:00

Fix test writer flush happening too late

This commit is contained in:
Dean Herbert 2020-04-13 17:52:04 +09:00
parent 6aab19413c
commit dd949a3fe0

View File

@ -324,9 +324,10 @@ namespace osu.Game.Tests.Editor
private byte[] encode(IBeatmap beatmap)
{
using (var encoded = new MemoryStream())
using (var sw = new StreamWriter(encoded, leaveOpen: true))
{
new LegacyBeatmapEncoder(beatmap).Encode(sw);
using (var sw = new StreamWriter(encoded))
new LegacyBeatmapEncoder(beatmap).Encode(sw);
return encoded.ToArray();
}
}
@ -334,7 +335,7 @@ namespace osu.Game.Tests.Editor
private IBeatmap decode(byte[] state)
{
using (var stream = new MemoryStream(state))
using (var reader = new LineBufferedReader(stream, true))
using (var reader = new LineBufferedReader(stream))
return Decoder.GetDecoder<Beatmap>(reader).Decode(reader);
}
}