Prefer ReadUInt8 over ReadByte.

The former will throw when the end of the stream is reached, rather than requiring the caller to check for -1.
This commit is contained in:
RoosterDragon
2020-10-18 11:35:21 +01:00
committed by abcdefg30
parent f5f2f58664
commit aac1bae899
10 changed files with 39 additions and 39 deletions

View File

@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.FileSystem
s.Position += 12;
var chunkSize = s.ReadUInt16();
s.Position += 4;
var nameLength = s.ReadByte();
var nameLength = s.ReadUInt8();
var fileName = dirName + "\\" + s.ReadASCII(nameLength);
// Use index syntax to overwrite any duplicate entries with the last value