Skip to content

Commit

Permalink
Streamline name reading
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHinrichs authored Sep 10, 2024
1 parent f6227b8 commit ee3ddee
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,7 @@ static void Main(string[] args)
br.BaseStream.Position = metaOffset;
for (int i = 0; i < subfile.Length; i++)
{
long nameOffset = br.BaseStream.Position;
char[] fileName = Array.Empty<char>();
char readChar = (char)1;
while (readChar > 0)
{
readChar = br.ReadChar();
Array.Resize(ref fileName, fileName.Length + 1);
fileName[^1] = readChar;
}
Array.Resize(ref fileName, fileName.Length - 1);
subfile[i].Name = new(fileName);
br.BaseStream.Position = nameOffset + 0XF8;
subfile[i].Name = new string(br.ReadChars(0XF8)).TrimEnd('\0');
subfile[i].Offset = br.ReadUInt32();
subfile[i].Size = br.ReadUInt32();
}
Expand Down

0 comments on commit ee3ddee

Please # to comment.