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/drawing/drawing.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/drawing/drawing.rb')
| -rw-r--r-- | lib/axlsx/drawing/drawing.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/drawing/drawing.rb b/lib/axlsx/drawing/drawing.rb index 8cb3e2cc..fa7a608c 100644 --- a/lib/axlsx/drawing/drawing.rb +++ b/lib/axlsx/drawing/drawing.rb @@ -109,14 +109,14 @@ module Axlsx # @return [Array] def hyperlinks links = self.images.select { |a| a.hyperlink.is_a?(Hyperlink) } - links.map { |a| a.hyperlink } + links.map(&:hyperlink) end # An array of image objects that are associated with this drawing's anchors # @return [Array] def images images = @anchors.select { |a| a.object.is_a?(Pic) } - images.map { |a| a.object } + images.map(&:object) end # The index of this drawing in the owning workbooks's drawings collection. |
