You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidMain(){varlist=Enumerable.Range(0,100).ToList();list.SpanIterate(l =>{Console.WriteLine(l);});}internalstaticclassMyExtensions{/// <summary>ONLY USE ON LISTS THAT CANNOT CHANGE DURING PROCESSING</summary>internalstaticvoidSpanIterate<T>(thisList<T>list,Action<T>action){varspan=CollectionsMarshal.AsSpan(list);for(vari=0;i<span.Length;i++){action(span[i]);}}internalstaticvoidSpanIterate<T>(thisIReadOnlyList<T>list,Action<T>action){varspan=CollectionsMarshal.AsSpan(list.ToList());for(vari=0;i<span.Length;i++){action(span[i]);}}}
The text was updated successfully, but these errors were encountered:
Quick code sample would look like:
The text was updated successfully, but these errors were encountered: