Skip to content

Commit

Permalink
Corrected enumeration within using block
Browse files Browse the repository at this point in the history
  • Loading branch information
LTRData committed Jan 10, 2025
1 parent fc13445 commit e4d5b59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Library/DiscUtils.Core/Vfs/VfsFileSystemFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ public IEnumerable<FileSystemInfo> Detect(Stream stream)
/// <returns>A list of file systems (may be empty).</returns>
public IEnumerable<FileSystemInfo> Detect(VolumeInfo volume)
{
using Stream stream = volume.Open();
return Detect(stream, volume);
using var stream = volume.Open();

foreach (var fs in Detect(stream, volume))
{
yield return fs;
}
}

/// <summary>
Expand Down

0 comments on commit e4d5b59

Please sign in to comment.