Skip to content

Commit

Permalink
simplify GetModChecksum256
Browse files Browse the repository at this point in the history
  • Loading branch information
Morilli committed Oct 18, 2024
1 parent 7d68a0b commit f748f93
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/BizHawk.Emulation.Common/DSKIdentifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,7 @@ public class Sector
public byte[] SectorData { get; set; }
public bool ContainsMultipleWeakSectors { get; set; }

public int GetModChecksum256()
{
int res = 0;
for (int i = 0; i < ActualDataByteLength; i++)
{
res = (res + SectorData[i]) % 256;
}
return res;
}
public byte GetModChecksum256() => (byte) (SectorData.Sum(static b => b) & 0xFF);
}
}
}

0 comments on commit f748f93

Please sign in to comment.