REFACTOR: Loop can be converted into LINQ-expression.

This commit is contained in:
2017-12-21 07:08:26 +00:00
parent 4d886dae25
commit 5592f147ac
71 changed files with 668 additions and 1131 deletions

View File

@@ -725,13 +725,11 @@ namespace DiscImageChef.DiscImages
bool extentFound = false;
ulong extentStartSector = 0;
foreach(KeyValuePair<ulong, VMwareExtent> kvp in extents)
if(sectorAddress >= kvp.Key)
{
currentExtent = kvp.Value;
extentFound = true;
extentStartSector = kvp.Key;
}
foreach(KeyValuePair<ulong, VMwareExtent> kvp in extents.Where(kvp => sectorAddress >= kvp.Key)) {
currentExtent = kvp.Value;
extentFound = true;
extentStartSector = kvp.Key;
}
if(!extentFound)
throw new ArgumentOutOfRangeException(nameof(sectorAddress),