mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-23 15:24:56 +00:00
Reduce Linq to better query
This commit is contained in:
@@ -44,8 +44,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
uint firstSectionAddress = Model.SectionTable
|
||||
.Select(s => s?.PointerToRawData ?? 0)
|
||||
.Where(s => s != 0 && s >= headerStartAddress)
|
||||
.OrderBy(s => s)
|
||||
.FirstOrDefault();
|
||||
.Min();
|
||||
|
||||
// Check if the header length is more than 0 before reading data
|
||||
int headerLength = (int)(firstSectionAddress - headerStartAddress);
|
||||
@@ -86,8 +85,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
uint firstSectionAddress = Model.SectionTable
|
||||
.Select(s => s?.PointerToRawData ?? 0)
|
||||
.Where(s => s != 0 && s >= headerStartAddress)
|
||||
.OrderBy(s => s)
|
||||
.FirstOrDefault();
|
||||
.Min();
|
||||
|
||||
// Check if the header length is more than 0 before reading strings
|
||||
int headerLength = (int)(firstSectionAddress - headerStartAddress);
|
||||
|
||||
Reference in New Issue
Block a user