mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Invert 'if' statement to reduce nesting.
This commit is contained in:
@@ -160,22 +160,20 @@ namespace DiscImageChef.Filters
|
||||
|
||||
public override int Read(byte[] buffer, int offset, int count)
|
||||
{
|
||||
if(backStream.Position + count > backStream.Length)
|
||||
{
|
||||
SetPosition(backStream.Position + count);
|
||||
SetPosition(backStream.Position - count);
|
||||
}
|
||||
if(backStream.Position + count <= backStream.Length) return backStream.Read(buffer, offset, count);
|
||||
|
||||
SetPosition(backStream.Position + count);
|
||||
SetPosition(backStream.Position - count);
|
||||
|
||||
return backStream.Read(buffer, offset, count);
|
||||
}
|
||||
|
||||
public override int ReadByte()
|
||||
{
|
||||
if(backStream.Position + 1 > backStream.Length)
|
||||
{
|
||||
SetPosition(backStream.Position + 1);
|
||||
SetPosition(backStream.Position - 1);
|
||||
}
|
||||
if(backStream.Position + 1 <= backStream.Length) return backStream.ReadByte();
|
||||
|
||||
SetPosition(backStream.Position + 1);
|
||||
SetPosition(backStream.Position - 1);
|
||||
|
||||
return backStream.ReadByte();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user