diff options
| author | Geremia Taglialatela <[email protected]> | 2023-06-15 09:20:31 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-06-15 09:20:31 +0200 |
| commit | 9e5bc61c60f8775150163d6d2da73d60083f0dbd (patch) | |
| tree | dccab6808cde0975e2cd32f69e234b3394b36b3e /lib/axlsx/drawing | |
| parent | ad87c51bf8c8f59a36514bb95dc6d3a582c6b2fd (diff) | |
| download | caxlsx-9e5bc61c60f8775150163d6d2da73d60083f0dbd.tar.gz caxlsx-9e5bc61c60f8775150163d6d2da73d60083f0dbd.zip | |
Fix Lint/UnusedBlockArgument offenses
Use `each_value` instead of `each` where possible. The performance gain
is minimal (3%).
```
Comparison:
each_value: 4105733.4 i/s
each: 3998011.4 i/s - 1.03x (± 0.00) slower
```
Diffstat (limited to 'lib/axlsx/drawing')
| -rw-r--r-- | lib/axlsx/drawing/axes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index 010fe8cd..f63ef95d 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -32,7 +32,7 @@ module Axlsx def to_xml_string(str = +'', options = {}) if options[:ids] # CatAxis must come first in the XML (for Microsoft Excel at least) - sorted = axes.sort_by { |name, axis| axis.is_a?(CatAxis) ? 0 : 1 } + sorted = axes.sort_by { |_name, axis| axis.is_a?(CatAxis) ? 0 : 1 } sorted.each { |axis| str << '<c:axId val="' << axis[1].id.to_s << '"/>' } else axes.each { |axis| axis[1].to_xml_string(str) } |
