mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Loop can be converted into LINQ-expression.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
@@ -205,7 +206,7 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
public static byte[] EncodeMode6(DecodedMode mode, PeripheralDeviceTypes deviceType)
|
||||
{
|
||||
int modeSize = 0;
|
||||
if(mode.Pages != null) foreach(ModePage page in mode.Pages) modeSize += page.PageResponse.Length;
|
||||
if(mode.Pages != null) modeSize += mode.Pages.Sum(page => page.PageResponse.Length);
|
||||
|
||||
byte[] hdr = EncodeModeHeader6(mode.Header, deviceType);
|
||||
modeSize += hdr.Length;
|
||||
|
||||
Reference in New Issue
Block a user