diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-23 01:29:34 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-31 09:58:46 +0200 |
| commit | 86026e2f106cb982f58f5a876756507d051aee4b (patch) | |
| tree | 192cb431e2f5af9323d32466709e7305b48520fb /lib/axlsx/workbook/workbook.rb | |
| parent | 3aa92cd2be4b535d1b21d2ba02f0e7660ccc6a05 (diff) | |
| download | caxlsx-86026e2f106cb982f58f5a876756507d051aee4b.tar.gz caxlsx-86026e2f106cb982f58f5a876756507d051aee4b.zip | |
Fix Style/SymbolProc offenses
This also provides a performance improvement
```
Comparison (array of 4 elements):
map(&): 3643131.4 i/s
map {}: 3488052.5 i/s - 1.04x (± 0.00) slower
Comparison (array of 20 elements):
map(&): 466013.9 i/s
map {}: 408447.2 i/s - 1.14x (± 0.00) slower
```
Diffstat (limited to 'lib/axlsx/workbook/workbook.rb')
| -rw-r--r-- | lib/axlsx/workbook/workbook.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index ec80d6dc..2c6e0491 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -171,7 +171,7 @@ module Axlsx # @see Comment # @return [Comments] def comments - worksheets.map { |sheet| sheet.comments }.compact + worksheets.map(&:comments).compact end # The styles associated with this workbook @@ -369,7 +369,7 @@ module Axlsx # generates a shared string object against all cells in all worksheets. # @return [SharedStringTable] def shared_strings - SharedStringsTable.new(worksheets.collect { |ws| ws.cells }, xml_space) + SharedStringsTable.new(worksheets.collect(&:cells), xml_space) end # The xml:space attribute for the worksheet. |
