Skip to content

Instantly share code, notes, and snippets.

@bnayae
Created May 12, 2018 19:30
Show Gist options
  • Save bnayae/4af9945e6de5c32095786e7eb44e5881 to your computer and use it in GitHub Desktop.
Save bnayae/4af9945e6de5c32095786e7eb44e5881 to your computer and use it in GitHub Desktop.
var spanData = new Span<int>(Data);
for (int i = 0; i < Data.Length - (BUFFER_SIZE + 1); i += BUFFER_SIZE)
{
var subSpan = spanData.Slice(i, BUFFER_SIZE);
if (subSpan[BUFFER_SIZE - 1] != i + BUFFER_SIZE - 1)
throw new Exception();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment