[Refactor] Use collection expressions.

This commit is contained in:
2024-05-01 04:39:38 +01:00
parent f7ca79b09e
commit 134ce7041e
667 changed files with 12936 additions and 13750 deletions

View File

@@ -131,17 +131,13 @@ public class Mpeg
#endregion
static readonly byte[] _mpeg2PackHeaderStartCode =
{
0x0, 0x0, 0x1
};
static readonly byte[] _mpeg2PackHeaderStartCode = [0x0, 0x0, 0x1];
public static bool ContainsMpegPackets(byte[] sectorData, uint blocks = 1, uint blockSize = 2048)
{
for(uint i = 0; i < blocks; i++)
{
if(IsMpegPacket(sectorData.Skip((int)(i * blockSize)))) return true;
}
if(IsMpegPacket(sectorData.Skip((int)(i * blockSize))))
return true;
return false;
}