kevin-montrose / Cesil

Modern CSV (De)Serializer
MIT License
65 stars 3 forks source link

Remove copying of data that happens when a range is taken of a DynamicRow #36

Closed kevin-montrose closed 3 years ago

kevin-montrose commented 3 years ago

Introduces a new DynamicRowRange type that is used when a range is taken of a DynamicRow. This removes the "copy the whole subset"-behavior from taking ranges of DynamicRows, fixing #9.

DynamicRowRange essentially stores a reference to a DynamicRow, and will keep it alive until all ranges and the row are disposed. This makes taking a range of a DynamicRow O(1), instead of O(n) (relative to the number of cells taken from the row).

Internal changes