summaryrefslogtreecommitdiffhomepage
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorPaul Kmiec <[email protected]>2023-05-10 21:34:19 -0700
committerPaul Kmiec <[email protected]>2023-05-10 21:34:19 -0700
commit1d94514b6562131371130449eaccf711aa60dc95 (patch)
tree7b8a034297d3d3a3a552e08372520651c3fa040a /CHANGELOG.md
parent67d8a1a781e53761a483575cc5abc7e9a992d2ca (diff)
downloadcaxlsx-1d94514b6562131371130449eaccf711aa60dc95.tar.gz
caxlsx-1d94514b6562131371130449eaccf711aa60dc95.zip
Derive SimpleTypedList from Array
Currently the SimpleTypedList is wrapping `@list` Array and re-implementing certain methods to add type / value checking and delegating all the non-destrutive methods to the internal @list. Most everything that ends up being serialized to the excel file is derived from SimpleTypedList (for example, a Row is a SimpleTypedList of Cells). This means that many of the delegated methods are hit over and over again especially `[]`. This extra delegation really adds up. We can avoid the delegation by having SimpleTypedList extend Array and still remove any un-safe methods. It is possible to re-introduce an unsafe method in a subclass of SimpleTypedList if needed. Here is one way, ```ruby class MyList < SimpleTypedList def clear @clear_method ||= Array.instance_method(:clear).bind(self) @clear_method.call end end ```
Diffstat (limited to 'CHANGELOG.md')
0 files changed, 0 insertions, 0 deletions