Skip to content

Instantly share code, notes, and snippets.

@ocoanet
Last active April 13, 2018 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ocoanet/067c79436451605c13d7f487e327c672 to your computer and use it in GitHub Desktop.
Save ocoanet/067c79436451605c13d7f487e327c672 to your computer and use it in GitHub Desktop.
public T this[long sequence]
{
get
{
ref var firstItem = ref Unsafe.As<object, T>(ref _entries[0]);
var index = _bufferPad + (int)(sequence & _indexMask);
return Unsafe.Add(ref firstItem, index);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment