Skip to content

Commit

Permalink
[ISO9660] Fixed performance issue caused by reading the whole data pr…
Browse files Browse the repository at this point in the history
…evious to the asked offset.
  • Loading branch information
claunia committed Jan 4, 2025
1 parent b7dabe6 commit 66cb455
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Aaru.Filesystems/ISO9660/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ ErrorNumber ReadWithExtents(long offset, long size, List<(uint extent, uint
byte fileNumber, out byte[] buffer)
{
var ms = new MemoryStream();
long currentFilePos = 0;
long currentFilePos = offset;

for(var i = 0; i < extents.Count; i++)
{
Expand All @@ -496,8 +496,8 @@ ErrorNumber ReadWithExtents(long offset, long size, List<(uint extent, uint
continue;
}

long leftExtentSize = extents[i].size;
uint currentExtentSector = 0;
var currentExtentSector = (uint)(offset / 2048);
long leftExtentSize = extents[i].size - currentFilePos;

while(leftExtentSize > 0)
{
Expand Down

0 comments on commit 66cb455

Please sign in to comment.