thesadrogue / TheSadRogue.Primitives

A collection of primitive data structures for working with a 2-dimensional grid.
MIT License
21 stars 6 forks source link

Make ISettableGridView.Fill faster for ArrayView #76

Closed Chris3606 closed 2 years ago

Chris3606 commented 2 years ago

Ideally, the .Fill extension method could do similar special-case logic as BitArray to gain this efficiency, since the performance gains can be quite substantial (well worth the cost of the cast).

Chris3606 commented 2 years ago

Note: A second (potentially better) possibility might be to remove the ISettableGridView.Fill extension method, and make it a default interface method instead, so that the derived types themselves can override it. However, this may be impossible to accomplish without a (very minor) breaking change to the API.