diff options
| author | Paul Kmiec <[email protected]> | 2023-05-14 20:01:22 -0700 |
|---|---|---|
| committer | Paul Kmiec <[email protected]> | 2023-05-15 13:55:04 -0700 |
| commit | 57865b2f08ae301f4d6815211fba59fefafcec33 (patch) | |
| tree | 60510659a8b9cb9409ce8e52e99b1f5bd05c5259 /lib/axlsx.rb | |
| parent | 71b358f0c73c73f88275b4c1c89fdf5372281ada (diff) | |
| download | caxlsx-57865b2f08ae301f4d6815211fba59fefafcec33.tar.gz caxlsx-57865b2f08ae301f4d6815211fba59fefafcec33.zip | |
Also cache row_ref
The `row_ref` method is called once for each column in a row and once at the
row level.
Diffstat (limited to 'lib/axlsx.rb')
| -rw-r--r-- | lib/axlsx.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 30683458..bf16afbd 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -125,7 +125,6 @@ module Axlsx end chars.prepend((i + 65).chr) chars.freeze - chars end end @@ -133,7 +132,8 @@ module Axlsx # @note The spreadsheet rows are 1-based and the passed in index is 0-based, so we add 1. # @return [String] def self.row_ref(index) - (index + 1).to_s + @row_ref ||= {} + @row_ref[index] ||= (index + 1).to_s.freeze end # @return [String] The alpha(column)numeric(row) reference for this sell. |
